help-bash
[Top][All Lists]
Advanced

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

[Help-bash] Test exit status before printing the output without using te


From: Peng Yu
Subject: [Help-bash] Test exit status before printing the output without using temp file
Date: Sat, 30 Jan 2016 20:49:00 -0600

Hi, Suppose I want to only print the output of a program if the exit
status is 0.

So far, I can only find a solution using a temp file. That is, pipe
the output of the program to a temp file and then test the exist
status of the program. If the exit status is 0, then I cat the content
in the temp file.

Does anybody know if it is possible to have a solution without a temp file?

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]