Problems with UNC filenames passed to bash when called from a windows shortcut

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Jan 26 15:04:00 GMT 2012


On Jan 24 11:10, john refling wrote:
> I have noticed that some filenames (with spaces) specified as UNC paths are
> not passed properly as positional parameters at the cygwin / windows
> interface.
> 
> 
> Specifically, I have an XP shortcut to cygwin bash placed in my XP SendTo
> folder.  Bash calls another custom script called ARGTEST.sh. The names of
> files that were selected by the mouse before clicking the SendTo are tacked
> onto the end of the command line by the standard windows mechanism.
> 
> 
> These filenames ultimately become the positional parameters for the custom
> script, which simply prints them out.  The shortcut is named ARGTEST.
> 
> 
> So the "target" for the XP shortcut ARGTEST is the following:
> 
> 
>     %SYSTEMDRIVE%\cygwin\bin\bash.exe /ARGTEST.sh
> 
> 
> the script /ARGTEST.sh is nothing more than:
> 
> 
>     #!/bin/sh
>     export PATH=/bin
>     for i in "${@}"; do
>         echo "$i"
>     done
>     read -p "Press Enter..."
>     exit
> [...]
> Running the same 2 examples above, but selecting files on a network share
> results in some wrong results:
> 
> 
>     \\q04\place\mnt\mnt\how2bu.txt
>     \\q04\place\mnt\mnt\Questionable
>     \q04\place\mnt\mnt\Copy of how2bu.txt                (WRONG!)
>     \q04\place\mnt\mnt\tmp - must sort soon                (WRONG!)
>     \\q04\place\mnt\mnt\.master

Try setting the environment variable CYGWIN to "noglob" before calling
bash.  Other than that, I'm looking if we can fix that for 1.7.10.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list