Download The UNIX programming environment

Transcript
The UNIX programming environment
y* | Y* ) return 0;;
*)
echo "Resuming..."
return 1;;
esac
done
}
#####################################################
# Level 1
#####################################################
SignalHandler()
{
if ReallyQuit
then
exit 0
else
return 0
fi
}
# Call a function
#####################################################
# Level 0 : main program
#####################################################
trap SignalHandler 2 15
# Trap kill signals 2 and 15
echo "Type some lines of text..."
while read text
do
echo "$text - CTRL-C to exit"
done
Note that the logical tree structure of this program is upside down (the highest level comes at the
bottom). This is because all subroutines must be defined before they are used.
This example concludes our brief survey of the Bourne shell.
setuid and setgid scripts
file:///C|/Dokumente und Einstellungen/The UNIX programming environment.htm (72 von 198)20.11.2004 11:29:42