On Wed, 2007-05-16 at 09:24 -0600, Ryan Byrd wrote:
> I wanted to get first post...

Well you got the first lame top-post anyway.

> 
> Here's my solution:
> 
> #!/bin/bash
> 
> for i in $( ls  );

That can't deal with spaces in the names.  Neither does Dave's example.
Also, the original problem (/me scrolls down to the bottom to see...
sigh) talks about directories not files.  Hence:

find * -type d -maxdepth 0 | while read $d; do
        tgt=`expr substr $d 1 5`
        mv $d $tgt
done

> do
> src=$i
> tgt=`expr substr $i 1 5`
> mv $src $tgt
> done
> 
> 
> On 5/16/07, Dave Smith <[EMAIL PROTECTED]> wrote:
> >
> > Wade Preston Shearer wrote:
> > > I have a directory full of directories that are all named in the
> > > following manner:
>> > <snip>
> > > Is there an easy way via the command line to truncate them to just the
> > > first five characters (which would be just their ID number)?
><snip>


/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to