For Programmers: Free Programming Magazines  


Home > Archive > AWK > October 2004 > OffTopic: Moving files









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author OffTopic: Moving files
Pavol Juhas

2004-10-02, 3:55 pm

In article <61792dff.0410020334.356747aa@posting.google.com>, Svatoboj wrote:
> Ed Morton <morton@lsupcaemnt.com> wrote:

....
....[color=darkred]
> Thank you for your effort. This worked for. I modyfied it
> slightly to fit my expectations:
>
> ls | awk '{system("mv \"" $0 "\"" " "$1"_"$2 )}'

....
> I just wondered how to do it easily without using perl for instance.


zsh
autoload zmv
zmv '* *.jpg' '${f// ##/_}'
here " ##" matches 1 or more space characters. Use
less ${^fpath}/zmv(N) or
man zshcontrib
/zmv
to see the zmv documents.

Pavol
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com