If I type::echo system('grep -IRn foobar ~/.vim | grep -v backup')Vim displays the output of the shell command:$ grep -IRn foobar ~/.vim | grep -v backupWhich is the list of files containing the pattern foobar inside the folder ~/.vim, after removing the matches containing the pattern backup.:echo expand('`grep -IRn foobar ~/.vim | grep -v backup`')Vim does the same thing (without the newline at the end).:e `=system('grep -IRn foobar ~/.vim | grep -v backup | tail -1 | cut -d: -f1')`Vim edits the last file from the output of the previous shell command.The last 3 commands work without escaping the pipe.The latter is never interpreted as a command termination, probably because it's protected by the string. Maybe for the same reason this command works::echo 'hello | world'But If I want to populate the quickfix list with the same shell command and I type::cexpr system('grep -IRn foobar ~/.vim | grep -v backup')I have the following errors:E115: Missing quote: 'grep -IRn foobar ~/.vim E116: Invalid arguments for function system('grep -IRn foobar ~/.vim E15: Invalid expression: system('grep -IRn foobar ~/.vim It seems that the pipe was interpreted as a command termination, and that it must be escaped::cexpr system('grep -IRn foobar ~/.vim \| grep -v backup')The pipe is inside a string, and the command is almost identical to the first one with :echo where the pipe is not escaped.Why is it suddenly interpreted as a command termination with :cexpr system('shell cmd')?
Why is a pipe interpreted as a command termination in :cexpr system('shell cmd')?
command line;external command