Run command in new window
Steven Penny
svnpenn@gmail.com
Wed Dec 27 22:46:00 GMT 2017
On Wed, 27 Dec 2017 02:11:52, Jürgen Wagner wrote:
> Why don't you put the stuff to execute into a nice shell script and get
> rid of the intricacies of quoting on the command line level?
> That'a way easier to manage and test.
really that seems like the best option. the only drawback to that is you wouldnt
be able to pass parameters to the script, else you run right back into the
previous problem:
$ cat hw.sh
printf '%s\n' "$@"
read
$ z='hello world'
$ cygstart bash hw.sh "$z"
hello
world
so then you try to fix it with quoting:
$ cygstart bash hw.sh "'$z'"
hello world
which works until you get a variable with single quote:
$ z=\'
$ cygstart bash hw.sh "'$z'"
# nothing
so you would either need a robust quoting solution [1], or need to create
temporary scripts for each invocation needed. not ideal either way
[1] http://cygwin.com/ml/cygwin/2017-12/msg00265.html
--
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