Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14
I don't think we've done anything Bash related. Jeremy...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907

    I don't think we've done anything Bash related.



    Jeremy
    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

  2. #12
    Just Joined!
    Join Date
    Jul 2004
    Posts
    85
    This is driving me crazy

    All I want is to write a simple script that will take an argument as such:
    Code:
    test "test dir"
    and would create a directory named "test dir." But it needs the dam space in its name. Becouse it going to go to my MP3 Player, and then the name is going to be extrapolated from the file name, and basically it is going to be mess if I use "_" becouse of the whole linux>win>mac file transfer blah.... Any way, so all I want is the dam directory to have a space in it's name. What am I doing wrong?

    Here is a simple version of the script above:
    Code:
    $ test "test dir"
    
    file=$1
    mkdir $file
    Things I experimented with with no success are
    Code:
    file=${1//\ /\\ }
    file="\"$1\""
    file="'$1'"
    and it steel does not work. Am I missing something totally stupid here?

    - Bogdan

  3. #13
    Linux Newbie
    Join Date
    Jul 2004
    Location
    WA, USA
    Posts
    102
    Just curious, why don't you make a partition on your hard drive that is FAT32? Then the compatibility between the systems would be sovled, if that is the only reason you are trying to include spaces.

    No, it doesn't solve your problems with bash very well... but it *is* a solution.

    Robert Peaslee
    Taking a walk on the wonderful path computers have lain before me

  4. #14
    Just Joined!
    Join Date
    Jul 2004
    Posts
    85
    I do not have win on my linux box, it is a headless server down in my garage So no need for FAT partition. And linux has no problems with names that have spaces, I am sure it is a problem somewhere in my code. I use win on my laptop because linux does not work on my current hardware, ACPI Problem

    Any way, if anyone out there feels charitable enough to show me how to pass names with spaces to mkdir inside a bash scrip, I would be grateful.

    - Bogdan

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •