Jak hromadne pracovat se soubory s mezerou v nazvu?
Jan Kasprzak
kas na informatics.muni.cz
Úterý Únor 11 16:00:51 CET 2003
Karel Bednar wrote:
: > normalne bych to udelal nasledovne:
: >
: > for file in $(/bin/ls /adresar) ; do
: > lame $file.wav ${file%%.wav}.mp3
: > done
: >
:
: co spis místo ls pouzit find a uvozovkovat. Tedy takhle:
:
: cil="/adresar/*.wav"
: for file in $(find "$cil" -type f -print); do
: lame "$file" "$file".mp3
: done
:
: Doporucuji
: http://docs.linux.cz/bashdoc-1.4/index.html
Funguje mozna na soubory s mezerou ve jmene, ale ne treba s newlinem.
Je potreba budto
for i in /adresar/*.wav
do
lame "$i" "${i%wav}mp3"
done
nebo pokud jde o podstrom, tak GNU findutils, find -print0 a xargs -0,
jak uz tady bylo receno.
-Y.
--
| Jan "Yenya" Kasprzak <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839 Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/ Czech Linux Homepage: http://www.linux.cz/ |
|-- If you start doing things because you hate others and want to screw --|
|-- them over the end result is bad. --Linus Torvalds to the BBC News --|
Další informace o konferenci Linux