On Sat, Jul 10, 2004 at 04:55:37PM +1000, Ronny Haryanto wrote:
> #!/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

Ini versi yg lebih error-tolerant:

#!/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]'`"
    if [ "${filename}" != "${new_name}" ]; then
        mv ${mv_opts} "${filename}" "${new_name}"
    fi
done

Ronny

Attachment: pgpsUsQX97GNe.pgp
Description: PGP signature

Kirim email ke