Web lists-archives.com

Re: Run command in new window

On Wed, 27 Dec 2017 17:46:37, cyg Simple wrote:
$ cygstart bash -c \"echo \\\'\; read\"
$ export z="'"
$ bash -c "echo \\${z}; read"


$ cygstart bash -c \"echo \\\\${z}\; read\"

this assumes that "z" is something, if you do "z=" then it breaks

$ bash -c 'echo \'; read'

fails to work when I think it should as the \ should cause the '
following it to be ignored by the command line processor.

na, you can never single quote a single quote, it is not possible. you have to
split the string on each single quote, assuming the string has any - then you
single quote the substrings as needed and escape the single delimiting quotes:

   $ echo "hello ' world"
   + echo 'hello '\'' world'

it gets more complicated with cygstart because an extra layer of
quoting/escaping is added - I about have a function to automate it - hopefully
will post soon

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