View previous topic :: View next topic |
Author |
Message |
sotha_sil Tux's lil' helper
Joined: 08 Mar 2005 Posts: 84
|
Posted: Thu Dec 08, 2005 2:29 pm Post subject: [solved] cd fails to work |
|
|
cd fails to work on certain directories. I have isolated the problem to this simple series of repeatable steps:
Code: | $ cd ~
$ mkdir "test 1" && mkdir "test 1/test 2"
$ cd "test 1/test 2"
basename: too many arguments
Try `basename --help' for more information.
$ pwd
/home/bob/test 1/test 2
basename: too many arguments
Try `basename --help' for more information.
$ ls
basename: too many arguments
Try `basename --help' for more information.
$ basename --help
Usage: basename NAME [SUFFIX]
or: basename OPTION
Print NAME with any leading directory components removed.
If specified, also remove a trailing SUFFIX.
--help display this help and exit
--version output version information and exit
Report bugs to <bug-coreutils@gnu.org>.
$ |
Last edited by sotha_sil on Fri Dec 09, 2005 4:32 am; edited 1 time in total |
|
Back to top |
|
|
plasmagunman l33t
Joined: 07 Jun 2002 Posts: 604 Location: berlin
|
Posted: Thu Dec 08, 2005 3:03 pm Post subject: |
|
|
do you know why it's always performing "basename" after each step? that's not normal. have you set anythink like PS1 or xterm-title to show the current working directory? perhaps something wants to know the name of the pwd after each command and it's doing something like instead of _________________ please, feel free to correct my english. - por favor, corrige mi español. |
|
Back to top |
|
|
nixnut Bodhisattva
Joined: 09 Apr 2004 Posts: 10974 Location: the dutch mountains
|
Posted: Thu Dec 08, 2005 6:25 pm Post subject: |
|
|
cd test\ 1/
use a "\" to escape (as it's called) the space. _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
talk is cheap. supply exceeds demand |
|
Back to top |
|
|
plasmagunman l33t
Joined: 07 Jun 2002 Posts: 604 Location: berlin
|
Posted: Thu Dec 08, 2005 11:17 pm Post subject: |
|
|
nixnut wrote: | cd test\ 1/
use a "\" to escape (as it's called) the space. |
if you escape the space you have to omit the double quotes. and shouldn't change a think: and should be the same. _________________ please, feel free to correct my english. - por favor, corrige mi español. |
|
Back to top |
|
|
sotha_sil Tux's lil' helper
Joined: 08 Mar 2005 Posts: 84
|
Posted: Fri Dec 09, 2005 4:32 am Post subject: |
|
|
plasmagunman wrote: | do you know why it's always performing "basename" after each step? that's not normal. have you set anythink like PS1 or xterm-title to show the current working directory? perhaps something wants to know the name of the pwd after each command and it's doing something like instead of |
Wow. You are a genius. My .bashrc file displays the current directory in the prompt via this line:
Code: | PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]$(basename $PWD) \$ \[\033[00m\]' |
Commenting out that line and replacing it with this next bit seems to have fixed the problem:
Code: | PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]$(basename "$PWD") \$ \[\033[00m\]' |
btw: I tested and found out that is the same as |
|
Back to top |
|
|
|