I want to do this:
./first.sh
if [ $? -ne 0 ]; then
exit
fi
# pipe output of first.sh to second.sh
So second.sh shouldn’t run unless first.sh succeeds but I don’t really know where to pipe the output of first.sh to in the mean time.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Why not dump it to a file, and then write that into
second.shiffirst.shsucceeds ?You may want to scope your file with a pid or similar if concurrency is an issue.