updated for version 7.4.247

Problem:    When passing input to system() there is no way to keep NUL and
            NL characters separate.
Solution:   Optionally use a list for the system() input. (ZyX)
This commit is contained in:
Bram Moolenaar
2014-04-05 18:55:46 +02:00
parent 4ed89cdf41
commit 57ebe6e2f9
3 changed files with 73 additions and 40 deletions
+11 -4
View File
@@ -5964,10 +5964,17 @@ synstack({lnum}, {col}) *synstack()*
system({expr} [, {input}]) *system()* *E677*
Get the output of the shell command {expr}.
When {input} is given, this string is written to a file and
passed as stdin to the command. The string is written as-is,
you need to take care of using the correct line separators
yourself. Pipes are not used.
When {input} is given and is a string this string is written
to a file and passed as stdin to the command. The string is
written as-is, you need to take care of using the correct line
separators yourself.
If {input} is given and is a |List| it is written to the file
in a way |writefile()| does with {binary} set to "b" (i.e.
with a newline between each list item with newlines inside
list items converted to NULs).
Pipes are not used.
Note: Use |shellescape()| or |::S| with |expand()| or
|fnamemodify()| to escape special characters in a command
argument. Newlines in {expr} may cause the command to fail.