Rob van der Heij writes:
>On 10/13/05, Alan Altmark <[EMAIL PROTECTED]> wrote:
>
>> to stdout itself. (I do this all the time in REXX execs - handle the
>> return codes I can deal with myself and dump to the console if I don't
>> recognize it. Is Linux so different?)
>
>Yep. You're missing CMS Pipelines and maybe REXX stems. As the
>examples show you must redirect output to a temporary file (and deal
>with the fact that some commands produce different output when
>redirected) and then read the file back in to see what was
>there.That's not elegant. My `vmcprc` was as close as I could get.
Actually, you can capture the output of any command into a shell variable,
you don't need to use the filesystem at all. With bash, you can then do
pattern matches on the variable value, so you don't need grep either. It
can all be done with shell built-ins:
Output="`vmcp ...`"
LinuxErr=$?
CPerr="${Output#CP Error: }"
Assuming that the output of the command contains a line that begins with
the string "CP Error: " followed by the CP error code, the above gives you
both the Linux and CP return codes. I still would like to see an option
that writes just the CP return code to a specified file descriptor, though.
- MacK.
-----
Edmund R. MacKenty
Software Architect
Rocket Software, Inc.
Newton, MA USA
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390