TurnKey Linux Virtual Appliance Library

[FIXED] Can't cd into folders with spaces in naming

Hey guys;

I was informed of an issue, which the more I delve into the scarier it gets... So, on my:

 ~# turnkey-version
turnkey-drupal6-11.2-lucid-x86
 

I can no longer cd into folders with spaces in their names... i.e.:

**************************************************************
Local File System Test:


root@xxx
~# mkdir "test folder"
root@xxx
~# ls -alF
total 124
drwx------ 11 root root 4096 Feb 14 14:47 ./
drwxr-xr-x 22 root root 4096 Feb 14 11:51 ../
drwx------ 2 root root 4096 Dec 16 16:29 .aptitude/
-rw------- 1 root root 32846 Feb 14 11:52 .bash_history
-rw-r--r-- 1 root root 2924 Dec 20 2010 .bashrc
drwxr-xr-x 2 root root 4096 Dec 20 2010 .bashrc.d/
drwx------ 2 root root 4096 Aug 25 18:17 .cache/
drwxr-xr-x 2 root root 4096 Dec 16 16:29 .debtags/
drwx------ 2 root root 4096 Jan 26 12:04 .gnupg/
-rw-r--r-- 1 root root 561 Dec 1 14:43 .htoprc
-rw------- 1 root root 43 Jan 11 16:50 .lesshst
-rw-r--r-- 1 root root 0 Aug 25 18:17 .penv
-rw-r--r-- 1 root root 140 Apr 23 2010 .profile
-rw------- 1 root root 1024 Dec 1 12:47 .rnd
drwx------ 2 root root 4096 Sep 8 19:40 .ssh/
drwxr-xr-x 2 root root 4096 Feb 7 15:13 .vim/
-rw------- 1 root root 17589 Feb 14 11:16 .viminfo
drwxr-xr-x 2 root root 4096 Feb 14 14:47 test folder/
root@xxx
~# cd test\ folder/
root@xxx
~/test# ls -alF
total 8
drwxr-xr-x 2 root root 4096 Feb 14 14:47 ./
drwx------ 11 root root 4096 Feb 14 14:47 ../


root@xxx
~/test# pwd
/root/test folder
root@xxx
~/test#

*************************************************************************

Mounted Filesystem Test (NFS)


root@xxx
www/nfsmount# ls -alF
total 456
drwxr-xr-x 52 www-data www-data 4096 Feb 6 14:04 ./
drwxrwx--x 5 www-data www-data 43 Feb 6 09:48 ../
-rw-r--r-- 1 www-data www-data 7449 Nov 2 2009 404.php
-rw-r--r-- 1 www-data www-data 6603 Mar 25 2009 500.php
drwxr-xr-x 3 www-data www-data 4096 Sep 19 12:01 Test Data/

root@xxx
www/nfsmount# cd Test\ Data/
dirname: extra operand `Data'
Try `dirname --help' for more information.
dirname: missing operand
Try `dirname --help' for more information.
-su: [: =: unary operator expected
basename: missing operand
Try `basename --help' for more information.

root@xxx /Test#

*******************************************************************************

This indeed has me stumped... I've tried re-installing the bash package, thinking that might be it, but no-go. Any and all help/input is very much appreciated!

 

Thanks,

--Russ

Fixed

So... it looks like, whereever the .bashrc under /etc/skel is coming from, is corrupt!

I replaced my .bashrc file from a std 10.04 ubuntu distro, and voila issue disappeared. I was able to reach this solution when I was comparing notes with a friend who stated in their profile they did not have the "promptpath" function which is the one that seems to be breaking this causing the above issues. Will file this as a bug report as well.


Alon Swartz's picture

Not corrupt, just a bug (no support for whitespace in path)

Thanks for reporting the issue. I committed a fix and posted the diff in the bug report.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)