I am trying to write simple function which runs a shell command and prints the result into vims shell output window, this here is a basic version of the function which does work:function defined in ~/.vimrcfunction! Runphp()    let s:runphp='cat /tmp/php_snippet | php'    echo(system(s:runphp))endfunctionfile /tmp/php_snippet<?php$a = ['apple', 'orange', 'bannana', 'pear'];print_r($a);If I run :call Runphp() vim prints the result of the executed PHP in the result window, all good.The problem occurs where the <?php tag doesn't already exist in /tmp/php_snippet i.e.file /tmp/php_snippet looks like this:$a = ['apple', 'orange', 'bannana', 'pear'];print_r($a);and I try to inject <?php as part of the shell command, i.e.function! Runphp()    let s:runphp='{ echo <?php; cat /tmp/php_snippet } | php'    echo(system(s:runphp))endfunctionIf I :call Runphp() now, vim returnsError detected while processing function Runphp:  line    3:  E484: Can't open file /tmp/vReTqKG/9How can I deal with this error so I can get this extra <?php injected into the shell command?
Working with shell command strings in vim's system() function
vimscript
From man bash:Compound Commands   A compound command is one of the following:   ...   { list; }          list  is simply executed in the current shell environment.  list          must be terminated with a newline or semicolon.  This  is  known          as  a  group  command. Note: in { echo <?php; cat /tmp/php_snippet } | php, you need a ; before the closing brace. Unless you're using zsh, in which case the whole thing would have worked fine.The output from bash isn't particularly helpful:$ bash -c '{ echo <?php; cat /tmp/php_snippet } | php'  bash: -c: line 1: syntax error: unexpected end of fileHowever, I can find no way to get system to return even this error message, without manually calling bash -c.