14 June 2013

Linux : Run commands consecutively and grep output of all of them

Simply enclose the commands you want to grep in parentheses.

Examples :
> (./task1.sh && ./task2.sh) | grep "fail"
> (./task1.sh ; ./task2.sh) | grep "error"
Post a Comment