Luc Hermitte (Vim Github Repository) schrieb am 12.10.2016 um 10:40:
> I've tested that:
> :let job = job_start(['sh', '-c', 'echo "foo"'])
> :echo job_info(job)
> returns
> |{'status': 'dead', 'stoponexit': 'term', 'exitval': 0, 'exit_cb': 0, 
> 'channel': channel 23 closed, 'process': 14090} |
> And that in the shell (UNIX)
> FOO="bar" sh -c 'echo $FOO'
> works well.
> However,
> " neither
> :let job = job_start(['FOO="bar" sh', '-c', 'echo "foo"'])
> " nor
> :let job = job_start(['FOO="bar"', 'sh', '-c', 'echo "foo"'])
> " nor
> :let job = job_start('(FOO="bar" && echo "foo")')
> "NB: I haven't even tried to display `$FOO`, yet.
> give correct results. In all cases, I get an /exitval/ of 122.
> While I can't be sure, it looks like a limitation of |job_start|. If there a 
> workaround that works, it'd be interesting to document it.

quoted from :help job_start()

| job_start({command} [, {options}])                    *job_start()*
|               {command} can be a List, where the first item is the executable
|               and further items are the arguments.  All items are converted
|               to String.  This works best on Unix.

Note that the last paragraph says that the first item of the list is an 

Further down the help says

|               The command is executed directly, not through a shell, the
|               'shell' option is not used.  To use the shell: >

You provided different variations of a shell command, but they were all
interpreted as the name of an executable.


Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui