Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

To set the exit status of a shell script


#!/bin/sh
if cp "$1" "$1.bak"
then
    vi "$1"
    exit   # USE STATUS FROM vi
else
    echo "bkedit quitting: can't make backup?" 1>&2
    exit 1
fi
Source by www.cs.ait.ac.th #
 
PREVIOUS NEXT
Tagged: #To #set #exit #status #shell #script
ADD COMMENT
Topic
Name
3+1 =