Results 1 to 7 of 7

Thread: directory names with spaces

  1. #1

    directory names with spaces

    What do I enter in the bash profile so that the shell will handle directory names with spaces? KDE has no problems going into say /mnt/Windows/Progam Files but bash chokes on dir names that contain spaces.. SuSE 9, Drake 9.1 I forget which I was using at the time....

  2. #2

    Re:directory names with spaces

    /mnt/Windows/Progam\ Files

  3. #3

    Re:directory names with spaces

    I know that \ will work on a case by case basis, but I am looking for something a little more seemless -some of the default Linux installs of various distros the bash shell has no trouble with spaces, but not others -I guess I should just figure out which and examine the bash profile differences. I just thought someone might know the tweak off the top of thier head.

    I get frustrated when I do a command like

    cp -ax /some/directory /to/destination

    and it chokes on a subdirectory somewhere that contains a space in the name

  4. #4

    Re:directory names with spaces

    cp -ax /some/directory /to/destination should /not/ choke if it hits a space, the only times spaces effect anything is when inputting them, and you just need a \ or put the whole thing in quotes (eg "/foo/Program Files&quot

  5. #5

    Re:directory names with spaces

    i just use cp -R and never have an issue

    [pbharris@bugs ~/tmp]ls -R crappo/
    space one  space three  space two
    crappo/space one:
    crap  poo hoo
    crappo/space one/crap:
    crappo/space one/poo hoo:
    poo three
    crappo/space one/poo hoo/poo three:
    crappo/space three:
    crappo/space two:
    [pbharris@bugs ~/tmp]cp -R crappo morecrappo
    [pbharris@bugs ~/tmp]ls -R morecrappo/
    space one  space three  space two
    morecrappo/space one:
    crap  poo hoo
    morecrappo/space one/crap:
    morecrappo/space one/poo hoo:
    poo three
    morecrappo/space one/poo hoo/poo three:
    morecrappo/space three:
    morecrappo/space two:

  6. #6

    Re:directory names with spaces

    gorn -you're right, bad example on my part

    just trying to figure out why I have problems with some default bash configurations and not others

    pbharris -sometimes you are too funny, are you sure you were not the "old fart" in the now defunct "linux lounge" forums?

  7. #7

    Re:directory names with spaces

    hey Cmonster - i don't think so. i am working on geezer before i become old fart.

    you may wnat to check alaises - some distros alias the cp to somthing like cp -i , but i am not sure why that would matter.

Similar Threads

  1. File names get cut with ~1
    By llista in forum Linux - General Topics
    Replies: 1
    Last Post: 08-16-2007, 12:01 PM
  2. Distros Names
    By GhostDawg in forum Linux - General Topics
    Replies: 3
    Last Post: 08-31-2003, 07:46 PM
  3. What are the device names??
    By Compunuts in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 08-24-2002, 05:28 AM
  4. domain names
    By imported_LinuxGuy in forum Linux - General Topics
    Replies: 3
    Last Post: 07-27-2002, 06:11 PM
  5. Reserved names?
    By ndogg in forum Announcements and Suggestions
    Replies: 5
    Last Post: 01-02-2002, 12:59 PM


Posting Permissions

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