Hi Dazza,
This script is untested (naturally)... probably broken but not hard to fix.
~~~~~~
#!/bin/sh
for file in *
do
first=`echo $file | cut -c1`
cp $file /home/ftp/pub/doc/$first/.
done
~~~~~~
Cheers,
Marty
On Monday, November 13, 2000 11:22 AM, DaZZa [SMTP:[EMAIL PROTECTED]] wrote:
> Folks.
>
> I know this is a little off topic, but I need some help.
>
> I need a script which will basically run through a directory, and copy all
> files which start with the same letter of the alphabet to a destination
> directory.
>
> For example, soemthing like this
>
> cp a*.doc /home/ftp/pub/doc/a/
>
> except I need it for the entire possible alphabet - AaBbCc etc.
>
> I also know stuff all about writing shell scripts - something I've got to
> find time to read up on. Oh - I'm using bash as my shell.
>
> Any shell guru's point me in the right direction?
>
> Thanks.
>
> DaZZa
>
>
>
> --
> SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
> More Info: http://slug.org.au/lists/listinfo/slug
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug