[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Catching both the exit status and the output



i don't want to give away any of Byron's secrets, but rc-1.5 has a new
feature (which Byron said was 1 line of code or so), which is that
when you use a backquote, the variable $bqstatus is set to the exit
status of the backquoted command.

something like that would be easy to do in es, but setting a global
variable from a primitive is not very es-like.  perhaps the $&backquote
primitive should return the status as its first element, and the
%backquote primitive should be responsible for stripping it off.

note, by the way, that with the proposed %read builtin, the returned
value can be tested (~ $#result 0) to see if it's empty, which would
indicate eof, so none of this hackery is needed for that case.

paul