bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File renaming using SED in BASH


From: vian
Subject: Re: File renaming using SED in BASH
Date: Thu, 2 Oct 2008 23:31:00 -0700 (PDT)
User-agent: G2/1.0

On Sep 22, 4:55 am, MisterMuv <fz6...@hotmail.com> wrote:

> chg=echo $f |sed 's:(www.somewhere.net)::'
> mv $f $chg

> What am I doing wrong?

just use this: mv "$f" "$chg",
when your filenames are using spaces and other weird characters

Also, I would suggest removing trailing spaces from filenames:
for f in *; do chg=`echo $f | sed 's: (somewhere.net)::'`;mv "$f"
"$chg"; done

Yes, if you notice, you could forget nifty quotes ``, usually used for
command execution.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]