...
> #!/bin/sh
> # Ganti isi mv_opts seperlunya. Baca 'man mv'.
> mv_opts="-v -i"
> # Biasakan pake quotes. Ada filename yg mengandung spasi.
> for filename in "$@"; do
>     new_name="`echo $filename | tr '[A-Z]' '[a-z]'`"
>     mv ${mv_opts} "$filename" "${new_name}"
> done
...
>       find /data -print0 | xargs lower.sh

I don't think that works.

[EMAIL PROTECTED] rename]# find teztdir/ -print0 | xargs -0 ./lower.sh
mv -v -i teztdir/ teztdir/
mv: cannot move `teztdir/' to a subdirectory of itself, `teztdir/teztdir'
mv -v -i teztdir/AJxWI1 teztdir/ajxwi1
`teztdir/AJxWI1' -> `teztdir/ajxwi1'
mv -v -i teztdir/AJxWI1/NAzLV1 teztdir/ajxwi1/nazlv1
mv: cannot stat `teztdir/AJxWI1/NAzLV1': No such file or directory
mv -v -i teztdir/AJxWI1/HVOHI2 teztdir/ajxwi1/hvohi2
mv: cannot stat `teztdir/AJxWI1/HVOHI2': No such file or directory
mv -v -i teztdir/AJxWI1/PTbBE3 teztdir/ajxwi1/ptbbe3
mv: cannot stat `teztdir/AJxWI1/PTbBE3': No such file or directory
mv -v -i teztdir/AJxWI1/IGSFA4 teztdir/ajxwi1/igsfa4
mv: cannot stat `teztdir/AJxWI1/IGSFA4': No such file or directory
mv -v -i teztdir/AJxWI1/BRCOP5 teztdir/ajxwi1/brcop5
mv: cannot stat `teztdir/AJxWI1/BRCOP5': No such file or directory
mv -v -i teztdir/AJxWI1/KJHAC1.txt teztdir/ajxwi1/kjhac1.txt
mv: cannot stat `teztdir/AJxWI1/KJHAC1.txt': No such file or directory
mv -v -i teztdir/AJxWI1/CDYEN2.txt teztdir/ajxwi1/cdyen2.txt
mv: cannot stat `teztdir/AJxWI1/CDYEN2.txt': No such file or directory
mv -v -i teztdir/AJxWI1/CAnOG3.txt teztdir/ajxwi1/canog3.txt
mv: cannot stat `teztdir/AJxWI1/CAnOG3.txt': No such file or directory
mv -v -i teztdir/AJxWI1/ZQRLB4.txt teztdir/ajxwi1/zqrlb4.txt
mv: cannot stat `teztdir/AJxWI1/ZQRLB4.txt': No such file or directory

[EMAIL PROTECTED] rename]# cat lower.sh
#!/bin/sh
# Ganti isi mv_opts seperlunya. Baca 'man mv'.
mv_opts="-v -i"
# Biasakan pake quotes. Ada filename yg mengandung spasi.
for filename in "$@"; do
        new_name="`echo $filename | tr '[A-Z]' '[a-z]'`"
        echo mv ${mv_opts} "$filename" "${new_name}"
        mv ${mv_opts} "$filename" "${new_name}"
done

[EMAIL PROTECTED] rename]# ls -lR teztdir
teztdir:
total 4
drwx------  7 root root 4096 Jul 19 09:16 AJxWI1/

teztdir/AJxWI1:
total 20
drwx------  2 root root 4096 Jul 19 09:15 BRCOP5/
-rw-------  1 root root    0 Jul 19 09:16 CAnOG3.txt
-rw-------  1 root root    0 Jul 19 09:16 CDYEN2.txt
-rw-------  1 root root    0 Jul 19 09:16 CSwHP5.txt
-rw-------  1 root root    0 Jul 19 09:16 file-HYUGB1.txt
-rw-------  1 root root    0 Jul 19 09:16 file-TAFUK5.txt
-rw-------  1 root root    0 Jul 19 09:16 file-XWKQI3.txt
-rw-------  1 root root    0 Jul 19 09:16 file-ZQEHV2.txt
-rw-------  1 root root    0 Jul 19 09:16 file-ZThCW4.txt
drwx------  2 root root 4096 Jul 19 09:15 HVOHI2/
drwx------  2 root root 4096 Jul 19 09:15 IGSFA4/
-rw-------  1 root root    0 Jul 19 09:16 KJHAC1.txt
drwx------  2 root root 4096 Jul 19 09:15 NAzLV1/
drwx------  2 root root 4096 Jul 19 09:15 PTbBE3/
-rw-------  1 root root    0 Jul 19 09:16 ZQRLB4.txt




-- 
Berhenti langganan: [EMAIL PROTECTED]
Arsip dan info: http://linux.or.id/milis.php

Kirim email ke