🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.linux.isp
Article #9

Re: help in linux shell script in copying files

#9
From: Gerhard W. Gruber
Date: Wed, 29 Jan 2003 22:51
29 lines
2329 bytes
On Thu, 30 Jan 2003 05:51:25 +0800 wrote "Laplace" <Laplace@tranforms.org> in
comp.os.linux.misc with <b19idc$mb42@imsp212.netvigator.com>

>if the "first letter is "A" or "a" copy it from \temp\ to \data\A\.... until
>finished A
>if the "first letter is "A" or "a" copy it from \temp\ to \data\A\.... until
>finished A to Z....
>
>algorithm
>
>if the "first letter is "A" or "a" copy it from \temp\  to \data\A\....
>
>if the "first letter is "B" or "b" copy it from \temp\ to \data\B\....
>
>
>
>
>up to Z....
>
>can u show me the script?

cd /temp; ls | while read f; do FIRST=`echo "$f" | cut -c1 | tr "[a-z]"
"[A-Z]"`: mv "$f" "/data/$FIRST/$f"; done

-- 
Gerhard Gruber

F�r jedes menschliche Problem gibt es immer eine einfache L�sung:
Klar, einleuchtend und falsch. (Henry Louis Mencken)
Technical Details
Message-ID: <ggmg3vkjlsrlpu9kai312vg7jfid4tp4v4@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.r-kom.de!newsfeed.arcor-online.net!news.arcor.de!not-for-mail
References: <b19idc$mb42@imsp212.netvigator.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 102983,9b430d37aa564f05
X-Google-Attributes: gid102983,public
X-Google-Thread: fe70d,9b430d37aa564f05
X-Google-Attributes: gidfe70d,public
X-Google-Thread: 102b32,9b430d37aa564f05
X-Google-Attributes: gid102b32,public
X-Google-Thread: 106e9e,9b430d37aa564f05
X-Google-Attributes: gid106e9e,public
X-Google-Thread: 1103af,9b430d37aa564f05
X-Google-Attributes: gid1103af,public
X-Google-ArrivalTime: 2003-01-29 14:52:38 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.r-kom.de!newsfeed.arcor-online.net!news.arcor.de!not-for-mail
From: Gerhard W. Gruber <sparhawk@gmx.at>
Newsgroups: alt.comp.linux.isp,aus.computers.linux,comp.os.linux.hardware,comp.os.linux.misc,comp.os.linux.security
Subject: Re: help in linux shell script  in copying  files
Date: Wed, 29 Jan 2003 23:51:43 +0100
Message-ID: <ggmg3vkjlsrlpu9kai312vg7jfid4tp4v4@4ax.com>
References: <b19idc$mb42@imsp212.netvigator.com>
X-Newsreader: Forte Agent 1.92/32.572
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Lines: 29
Organization: Arcor
NNTP-Posting-Date: 29 Jan 2003 23:52:37 MET
NNTP-Posting-Host: 212.144.200.16
X-Trace: DXC=K>F4FCXjE^FC;_l<5e4khA:ejgIfPPldDjW\KbG]kaMH[@a9`3l5c4BYOS8;QOoUZFg3LX5[[^J7D^W`N3^g<bHOj06aTO]Wg5L
X-Complaints-To: abuse@arcor-online.net