bm1x Posted June 11, 2019 Posted June 11, 2019 How can I print understand if my script fail without using debug ? I want to performa a script and if fail ... perform an action if success perform another action.
vitor Posted June 11, 2019 Posted June 11, 2019 Inside your Run Script Action, include a check for the exit status of your command, to see if it failed or succeeded. Depending on the outcome, make it output a different message. Then use a Conditional Utility to decide the next step.
bm1x Posted June 12, 2019 Author Posted June 12, 2019 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
deanishe Posted June 12, 2019 Posted June 12, 2019 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”. bm1x 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now