Jump to content

Output of Failed Script


Recommended Posts

Ok thanks.

isn't there a way to do it outside my script ? 

Because some of the script I use are used buy other systems and not Alfred exclusive

#! /bin/bash
./script1.bash
if [ $? -eq 0 ]
then
  echo "ok"
else
  echo "ko"
fi
echo "$?"
exit 0

 

Link to comment
1 hour ago, bm1x said:

isn't there a way to do it outside my script ?

 

Only by writing simple wrapper scripts as you’ve done there.

 

You probably only need to do “echo $?; exit 0” (no need for “echo ok”).

 

Downstream you can do “if {query} = 0”.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...