Re: Naming files

From: scriptOmatic (ScriptOmatic_at_ChironComputing.Com)
Date: 05/01/03


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.


Relevant Pages

  • Re: Naming files
    ... Phil wrote: ... >I have the following simple script for cleaning up filenames but it ...
    (comp.unix.shell)
  • Re: baffling open call blocking - newbie
    ... > arun wrote: ... > Many platforms are supplied already compiled. ... -- http://ftp.opensysmon.com is a shell script archive site with an open source system monitoring and network monitoring software package. ...
    (comp.unix.programmer)
  • Re: Listing user mailbox rights
    ... we need to give outlook users access to other ... > user exchange mailboxes for outlook. ... > Thanks in advance, Phil ... someone else here in this group is familiar with a script that will do just ...
    (microsoft.public.exchange2000.admin)
  • Re: Anybody good at sed scripting?
    ... Adam Skeggs wrote: ... >> open source system monitoring and network monitoring software package. ... The sed script in question, 900 lines long including comments, had ... sed has no for loop. ...
    (comp.unix.admin)
  • Re: Synchronize local administrator passwords using Group Policy
    ... Thanks Phil - that is currently how I have implemented it. ... MIT approach "appears" to be more elegant. ... doesn't appear to be via a startup script or other "shell" mechanism. ... >>who claim to have custom adm templates to achive this. ...
    (microsoft.public.win2000.group_policy)