Re: Run command in new window

2017-12-27 Thread Steven Penny
On Wed, 27 Dec 2017 17:46:37, cyg Simple wrote: $ cygstart bash -c \"echo \\\'\; read\" $ export z="'" $ bash -c "echo \\${z}; read" works $ 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

Re: Run command in new window

2017-12-27 Thread cyg Simple
On 12/26/2017 8:16 PM, Steven Penny wrote: > On Tue, 26 Dec 2017 17:44:11, cyg Simple wrote: >> If you want to pass quotes to the process on the command line then you >> need >> to quote them or use a backslash on the quote to prevent the shell doing >> the exec to process them. >> >> $ cygstart ba

Re: Run command in new window

2017-12-26 Thread Steven Penny
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

Re: Run command in new window

2017-12-26 Thread Steven Penny
On Tue, 26 Dec 2017 17:44:11, cyg Simple wrote: If you want to pass quotes to the process on the command line then you need to quote them or use a backslash on the quote to prevent the shell doing the exec to process them. $ cygstart bash -c \'echo 1\; read\' continuing from my previous email

Re: Run command in new window

2017-12-26 Thread Jürgen Wagner
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. --j. On 27.12.2017 00:44, Steven Penny wrote: > On Tue, 26 Dec 2017 17:44:11, cyg Simple wrote: >> If you want to pass quotes

Re: Run command in new window

2017-12-26 Thread Steven Penny
On Tue, 26 Dec 2017 17:44:11, cyg Simple wrote: If you want to pass quotes to the process on the command line then you need to quote them or use a backslash on the quote to prevent the shell doing the exec to process them. $ cygstart bash -c \'echo 1\; read\' I dont want to pass quotes. Sure,

Re: Run command in new window

2017-12-26 Thread cyg Simple
On 12/26/2017 2:41 PM, Steven Penny wrote: > 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 execute

Re: Run command in new window

2017-12-26 Thread Steven Penny
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 in

Re: Run command in new window

2017-12-26 Thread cyg Simple
On 12/26/2017 12:43 PM, Steven Penny wrote: > On Sun, 24 Dec 2017 21:08:17, Steven Penny wrote: >> that did it - thanks - this also works: >> >>     cygstart bash '-c "echo hello; read z"' >> >> seems like a problem with cygstart parser? here is the syntax: >> >>     cygstart [OPTION]... FILE [ARGU

Re: Run command in new window

2017-12-26 Thread Dave Caswell
> and for some reason any spaces must be quoted - not escaped - these work: > >cygstart bash -c '"echo 1;read"' >cygstart bash -c "'echo 1;read'" > > these fail: > >cygstart bash -c 'echo\ 1;read' >cygstart bash -c "echo\ 1;read" The '-v' option to cygstart gives the key to unders

Re: Run command in new window

2017-12-26 Thread Steven Penny
On Sun, 24 Dec 2017 21:08:17, Steven Penny wrote: that did it - thanks - this also works: cygstart bash '-c "echo hello; read z"' seems like a problem with cygstart parser? here is the syntax: cygstart [OPTION]... FILE [ARGUMENTS] so should support multiple arguments - this command wo

Re: Run command in new window

2017-12-24 Thread Steven Penny
On Sun, 24 Dec 2017 21:53:19, Dave Caswell wrote: Ah, OK. Here you go: davec@SodiumWin ~ $ cygstart /usr/bin/bash '-c "echo hello; sleep 5"' I wish I could explain just why this quotation pattern works here. A long time ago I found that dicking around with the quotes could often get things wo

Re: Run command in new window

2017-12-24 Thread Dave Caswell
On Sun, Dec 24, 2017 at 9:34 PM, Steven Penny wrote: > > yes, that is good if you want to use a script - but a command does not work: > >cygstart bash -c 'echo hello; sleep 5' > Ah, OK. Here you go: davec@SodiumWin ~ $ cygstart /usr/bin/bash '-c "echo hello; sleep 5"' I wish I could explain

Re: Run command in new window

2017-12-24 Thread Steven Penny
On Sun, 24 Dec 2017 21:06:05, Dave Caswell wrote: Here's an example: davec@SodiumWin ~ $ cygstart bash -e TT davec@SodiumWin ~ $ cat TT #! /usr/bin/bash echo TEST sleep 240 yes, that is good if you want to use a script - but a command does not work: cygstart bash -c 'echo hello; sleep 5'

Re: Run command in new window

2017-12-24 Thread Dave Caswell
On Sun, Dec 24, 2017 at 8:50 PM, Steven Penny wrote: > On Mon, 25 Dec 2017 06:28:50, Andrey Repin wrote: >> >> The usual way - prevent the closing of the new window. >> I.e. by adding a sleep. > > > no, that doesnt work > > have you tried it? > > if so provide sample command Here's an example: d

Re: Run command in new window

2017-12-24 Thread Steven Penny
On Mon, 25 Dec 2017 06:28:50, Andrey Repin wrote: The usual way - prevent the closing of the new window. I.e. by adding a sleep. no, that doesnt work have you tried it? if so provide sample command -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwi

Re: Run command in new window

2017-12-24 Thread Andrey Repin
Greetings, Steven Penny! > I can run a command line this as expected: > cygstart sleep 5 > However a command like this is a problem: > cygstart echo hello > a new window is open, and the command is run, but the window immediately > closes, > so you do not get to see the output. How ca