Loading ...
Sorry, an error occurred while loading the content.
 

Re: [redhat] Move filename contain blank trouble

Expand Messages
  • Michael Schwendt
    On Sat, 11 Dec 2004 07:37:13 -0800 (PST), Mohammad Sahami ... Why not? Rule of thumb: copy the console output to give a precise example of what behaviour you
    Message 1 of 18 , Dec 12 5:38 AM
      On Sat, 11 Dec 2004 07:37:13 -0800 (PST), Mohammad Sahami
      <sahami2001@...> wrote:
      >
      > I used double quote but it does not solve it.

      Why not?

      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:
      >
      > _file2=`echo $_file|sed 's/\"//g'|sed 's/\ /___/g'`
      >
      > But when script runs it issues errors.

      This is an incomplete example. What does the rest of the script do?
      What was in $_file when it failed? And why do you substitute \" with
      nothing?

      --
    • Cameron Simpson
      ... Bear in mind that ~ doesn t expand inside quotes. of course, he should be using $HOME anyway. So either: mv ~/user1/ $_file ~Archive/ or better: mv
      Message 2 of 18 , Dec 12 6:58 PM
        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/

        or better:

        mv "$HOME/user1/$_file" ~Archive/

        of course then there's ~Archivo to deal with as well...

        Cheers,
        --
        Cameron Simpson <cs@...> DoD#743
        http://www.cskk.ezoshosting.com/cs/

        "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.
      Your message has been successfully submitted and would be delivered to recipients shortly.