Closed GoogleCodeExporter closed 9 years ago
If I start the GF shell and enter
! echo hello
I get the expected output:
hello
Original comment by hallg...@chalmers.se
on 10 Apr 2013 at 3:02
It only does it with '?' ant not with all commands (I can't get help about '!'):
For instance it works with cat:
> pt "hey" | ? cat
hey
but not with tr
> pt "hey" | ? tr 'e' 'o'
tr: extra operand ‘_tmpi’
Try 'tr --help' for more information.
Original comment by gregoire...@gmail.com
on 10 Apr 2013 at 3:10
It seems that, for some reason (portability?), "?" doesn't create a pipe, but
instead puts the input to the system command in a temporary file _tmpi and
appends that filename to the end of the command. This should probably be
changed, since it only works with commands that can take input from a named
file (like cat, wc and grep, ...)
As a workaround, you can put a redirection symbol at the end of the command:
ps "hey" | ? tr e o <
Original comment by hallg...@chalmers.se
on 10 Apr 2013 at 3:24
The system_pipe (aka "?") command creates a temporary file _tmpi containing
the input of the system command. It *both* appends _tmpi as an extra argument
to the system command line *and* adds an input redirection "< _tmpi". (It
also uses and output redirection "> _tmpo" to captures the output of the
command.)
With this patch, the _tmpi argument is no longer appended to the command line.
This allows system_pipe to work with pure filters, such as the "tr" command,
but it will no longer work with commands that require an explicit input file
name.
(It is possible to use write_file instead...)
TODO: it would also be fairly easy to eliminate the creation of the _tmpi and
_tmpo files altogether.
Original comment by hallg...@chalmers.se
on 12 Nov 2013 at 6:26
Original issue reported on code.google.com by
gregoire...@gmail.com
on 10 Apr 2013 at 2:55