Re: [redhat] Move filename contain blank trouble
- On Sat, 11 Dec 2004 07:37:13 -0800 (PST), Mohammad Sahami
> I used double quote but it does not solve it.
Rule of thumb: copy the console output to give a precise example of
what behaviour you see. Keep your messages short but to the point.
> Meanwhile i created a filename replaced "\ " instead of " " in this manner:This is an incomplete example. What does the rest of the script do?
> _file2=`echo $_file|sed 's/\"//g'|sed 's/\ /___/g'`
> But when script runs it issues errors.
What was in $_file when it failed? And why do you substitute \" with
On 09:24 11 Dec 2004, Godwin Stewart <gstewart@...> wrote:
| On Fri, 10 Dec 2004 23:12:18 -0800 (PST), Mohammad Sahami
| <sahami2001@...> wrote:
| > some files have blank in filenames and when I want to move them it issues
| > an error.
| > mv ~user1/$_file ~Archive/
| Quote the source:
| mv "~/user1/$_file" ~Archive/
Bear in mind that ~ doesn't expand inside quotes. of course, he should
be using $HOME anyway. So either:
mv ~/user1/"$_file" ~Archive/
mv "$HOME/user1/$_file" ~Archive/
of course then there's ~Archivo to deal with as well...
Cameron Simpson <cs@...> DoD#743
"This _is_ my day job!"
- Graeme Wong See, replying to an all-too-common snide remark
regarding the quality of the seamless digital sound editing on
his Metallica "Enter Uodtjam" remix.