This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

error in bash's cd command



[administrator@GCP36W2K /]$ cd  "/d/cygwin/usr/local/bin "
                             ### Why does this work with the space in there?
[administrator@GCP36W2K /d/.../usr/local/bin]$ echo "'`pwd`'"
'/d/cygwin/usr/local/bin '   ### Note: there is a trailing space in the path
[administrator@GCP36W2K /d/.../usr/local/bin]$ ls
                             ### ls cannot find any files
[administrator@GCP36W2K /d/.../usr/local/bin]$ cd `pwd`
[administrator@GCP36W2K /d/.../usr/local/bin]$ ls
bc.exe*  cygwin_indir.bat*  echoping.exe*
[administrator@GCP36W2K /d/.../usr/local/bin]$


I noticed this problem because I wanted to set up a right-click action in
the shell similar to the "Command Prompt Here" power toy that you get from
Microsoft. So, I edit the Registry to call a DOS batch file passing it the
current directory name. The batch file converted that to a Unix path that
Cygwin bash could use and output that to a file. Then when the bash shell
starts it checks for that file and changes to the directory in it (if it
exists). Unfortunately, Windows 2000 puts a trailing space in the "%1" that
is passed from a right click-invoke command on file operation, even though I
have it double-quoted. I am guessing that ls is passing a directory path
ending with a space to opendir() which fails. 


 <<cygnus_info>> 
________________________________
Glen Coakley, Sr. Software Engineer
MQSoftware Inc., (763) 543-4845
Have you ever wonder what happens when you run "rm -rf / " but been afraid
to try it?

cygnus_info

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]