Re: help in linux shell script in copying files

From: Gerhard W. Gruber (sparhawk@gmx.at)
Date: 01/30/03


From: Gerhard W. Gruber <sparhawk@gmx.at>
Date: Thu, 30 Jan 2003 20:36:19 +0100

On Wed, 29 Jan 2003 23:30:06 GMT wrote Kirk Strauser <kirk@strauser.com> in
comp.os.linux.misc with <873cnb8s9x.fsf@strauser.com>

>> cd /temp; ls | while read f; do FIRST=`echo "$f" | cut -c1 | tr "[a-z]"
>> "[A-Z]"`: mv "$f" "/data/$FIRST/$f"; done
>
>Be careful! He'll lose homework points if any filenames start with [^a-zA-Z].

I know that. :) But that's his problem and he shouldn't abuse other people to
do his homework anyway. :) So while it works it should be always a good idea
to check if the answer is right and does what it is expected to do. :)

-- 
Gerhard Gruber
Für jedes menschliche Problem gibt es immer eine einfache Lösung:
Klar, einleuchtend und falsch. (Henry Louis Mencken)