how to fail a shell script programmatically

Upload: karthikre

Post on 08-Feb-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/22/2019 How to Fail a Shell Script Programmatically

    1/1

    How to fail a shell script programmatically?Just put an [exit] command in the shell script with return value other than 0. this is because the exit codes of successful Unix programs is zero. So, suppose if you write

    exit -1inside your program, then your program will thrown an error and exit immediately.