This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: pass arguments enclosed with double quotes from bash shell to windows program


On 4/2/2016 2:19 PM, Eliot Moss wrote:

> Have you tried:  '"arg"' ? bash should strip the ' ' and leave the " ".
> Also, what about "\"foo\"" ?
> 
> My experiments with this suggest that they work.  I tried invoked a .bat
> file that echoes its first argument, and it did show "\"foo\"", but I
> suspect that is how echo renders "foo", i.e., it wraps it in quotes and
> backslash protects the quotes.
> 
> Here's a function I use for invoking acrobat from the bash command line:
> 
> function acrobat () {
>   local ARG
>   [ -n "$1" ] && { ARG="$(cygpath -wa "$1")"; shift; }
>   command acrobat ${ARG:+"${ARG}"} "$@" > /dev/null &
> }
> 
> For it to work, acrobat needs to be on your path (I put a link in a
> directory
> that is on my path).  Anyway, works fine for me to pop up acrobat
> displaying
> a file.  I've not tired an incantation for printing ...

And there's always cygstart, no need to do anything special with the
arguments, if the file has the .pdf extension, it will be opened by the
default application, which usually is Acrobat.

Regards.
-- 
Renà Berber



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


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