Re: Naming files
From: scriptOmatic (ScriptOmatic_at_ChironComputing.Com)
Date: 05/01/03
- Next message: Barry Margolin: "Re: Naming files"
- Previous message: Phil: "Naming files"
- In reply to: Phil: "Naming files"
- Next in thread: Barry Margolin: "Re: Naming files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 30 Apr 2003 22:45:13 GMT
Phil wrote:
>
> Hi,
>
> I have the following simple script for cleaning up filenames but it
> doesn't seem to work:
>
> #!/bin/sh
>
> for F in $@
> do
> $NEW=`echo "$F" | sed -e 's/ /_/g' -e 's/[(|)]//g' -e 's/[,|!|-|(|)]//g'`
> echo "$NEW"
> done
>
> It seems to print out the spaced words line by line. Am I using in proper
> quoting?
>
> Thanks allot
> Phil Jackson
> --
> Where there's a will, I want to be in it.
NEW=` ....
not $NEW
also
Seems you are using the pipe bar to mean or in te sed commands.
They are not needed, [()] means "(" or ")"
-- http://ftp.opensysmon.com is a shell script archive site with an open source system monitoring and network monitoring software package. Many platforms are supplied already compiled.
- Next message: Barry Margolin: "Re: Naming files"
- Previous message: Phil: "Naming files"
- In reply to: Phil: "Naming files"
- Next in thread: Barry Margolin: "Re: Naming files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|