On 10/31/05, Todd Walton <[EMAIL PROTECTED]> wrote:
> On 10/30/05, Carl Lowenstein <[EMAIL PROTECTED]> wrote:
> > [EMAIL PROTECTED] try]$ cat foo5
> > #!/bin/bash
> >   n=0
> >   ls *.txt | while read old
> >   do ((n+=1))
> >   echo $old $(printf 'document-%04d.txt' $n)
> >   done
>
> Yes, but, this isn't very flexible.  It would take rewriting to take
> arguments for the files, and I want to arbitrarily specify what kind
> of sequence to use for the numbering, and I'd like to be able to reuse
> the existing file name if desired.  You (or I) could do this
> rewriting, but the point is to avoid having to do so.  The point is to
> hopefully find a moderately featured tool that already knows all this
> nifty stuff and maybe even more that I didn't know I wanted in the
> first place.

i agree. leave it on one line, and retrieve it for reuse with repeated ctrl-r

also, it is more readable with new=... (for me anyway) since it splits
the two tasks (construct a name; do the move).


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to