This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Run command in new window
- From: Steven Penny <svnpenn at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 26 Dec 2017 17:38:00 -0800 (PST)
- Subject: Re: Run command in new window
- Authentication-results: sourceware.org; auth=none
- References: <844ea576-1047-8366-d5b0-36a7ac2a5be7@wagner.is>
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