This is the mail archive of the cygwin@sources.redhat.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]

RE: backslash and backslash backslash


I don't know why your script doesn't work.  
I think it is more a problem of setting the
variable than later substitution.

I assume you meant to pipe into read in your example.
But even with a pipe your example doesn't work for me.
I assume it's because read is a shell builtin and so the
variable is set in a subshell.

Anyway I use a script like this to automatically fire
up associated windows apps.  "start file.html" starts
IE for example.  It is similar to yours but uses
command substitution to set the variable.

  #start - shell script
  winfile=$(cygpath -aws $1)

  #cd to c: to prevent problems if we are in a UNC path
  cd /cygdrive/c

  cmd /c start $winfile

The shell doesn't seem to do backslash substition
after variable substition.

> From: Wilson Farrell [mailto:wfarrell@bbn.com]
> 
> In an attempt to access Netscape's sendto from cygwin I 
> created a simple
> script:
> 
> sendto.sh
> -------
> #!/bin/bash
> 
> /usr/bin/cygpath.exe -aw $1; read mypath
> 
> /cygdrive/c/Apps/Netscape/Program/sendto32.exe $mypath
> -------
> So, in theory "sendto.sh myfile.txt" should send myfile.txt 
> to Netscape
> messenger as an attachment to a new mail. 
> 
> unfortunately since $mypath contains "\'s" instead of "\\'s" this
> fails.  sendto32.exe seems to require an absolute path name in dos
> format, which is why I used cygpath.
> 
> note, this works from the command line:
> /cygdrive/c/Apps/Netscape/Program/sendto32.exe 
> c:\\wfarrell\\myfile.txt
> 
> Is there an easy way to get around this problem.
> 
> thanks, 
> wilson
> --

--
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]