Web lists-archives.com

Re: Run command in new window




On Tue, 26 Dec 2017 11:54:14, Dave Caswell wrote:
$ cygstart -v bash -c \'echo 1\;read \'
ShellExecute(NULL, "(null)", "bash", "-c 'echo 1;read '", "(null)", 1)
By escaping the quotes and semicolon so they get passed along intact,
the executed bash also gets an intact command string.

this is interesting, but it doesnt explain (or im not understanding) why it will
accept a quoted string and not an escaped one. in a normal setting, these
commands are identical:

   $ bash -c 'echo; read'
   + bash -c 'echo; read'

   $ bash -c echo\;\ read
   + bash -c 'echo; read'

but with cygstart this command works:

   cygstart bash -c '"echo; read"'

and this does not:

   cygstart bash -c 'echo\;\ read'


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