At 08:22 AM 8/23/2001 -0500, Dean Morrell wrote:
>This is a newbie list right? [okay, good] I don't want to be too
>embarassed to ask a stuped question. Would someone be willing to explain
>what this does? I mean each character has significance, right? So what
>is it? This reminds me of the random characters thrown up on my screen
>after disconnecting from the old BBS.
>
>At 08:34 PM 8/22/2001 -0700, you wrote:
>> > for i in `ls /dirname | grep -e".+ .+"`; do mv $i `echo $i |
>> gawk '{ gsub(_, ,$0) }'` ; done
>
>
>Dean
Dean --
This was in response to someone wanting to replace all file
names with a space with a new name using underline in place
of space.
ls /dirname means list some directory (you should replace
dirname with a real directory) and | is a pipe character,
meaning feed the list output by ls to grep, which is a
utility that'll screen based on what're called 'regular
expressions' (pattern matching strings, e.g. like in DOS
you go *.* or a??.* -- only regexps are more complicated,
or can be). So it's supposed to find filenames with
spaces (I didn't test it) and these, in turn, get moved
i.e. renamed in the process. gawk enters in to do that,
and the who thing is a line of script (for i in... do...).
That's the general idea. Not as detailed as you might
like.
Kirby
Want to buy your Pack or Services from MandrakeSoft?
Go to http://wwww.mandrakestore.com