[clug] Bashism desired
Andrew Janke
a.janke at gmail.com
Tue Mar 12 06:39:32 MDT 2013
On 12 March 2013 16:37, steve jenkin <sjenkin at canb.auug.org.au> wrote:
> ls -1 >x.sh # grab a list of the filenames.
> # Could use ls -1|grep ' ' > x.sh # to find files with spaces.
>
> vi x.sh
> :%s,.*,mv -i '&'^I'&', # create proforma 'mv' command.
> # Don't type ^I, use <tab> key
> # sometimes I use " not ' for quoting...
> :%s,^I'prefix,^I'otherprefix'
> :%s,suffix'$,new-suffix',
> :wq
>
> sh ./x.sh
> # rm x.sh # when you're done...
man vidir
:)
a
More information about the linux
mailing list