diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-04-05 18:55:46 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-04-05 18:55:46 +0200 |
commit | 57ebe6e2f94edad6adc43246d98919e728095211 (patch) | |
tree | 7dc2718ae060133f59a57c82835e359defa05dfc /runtime | |
parent | 4ed89cdf41cf3d509fd30e6f7c577a7c090679a9 (diff) |
updated for version 7.4.247v7.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)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 3e839fb3e0..a4bb1f40ea 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -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. |