Added the example script.
This commit is contained in:
23
example.sh
Normal file
23
example.sh
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SECONDS=0
|
||||||
|
|
||||||
|
trap cleanexit 0
|
||||||
|
trap breakexit 2
|
||||||
|
trap commandexit 17
|
||||||
|
|
||||||
|
function cleanexit {
|
||||||
|
echo "$SECONDS, Finished!" >> time.log
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function breakexit {
|
||||||
|
echo "$SECONDS, CTRL+C" >> time.log
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function commandexit {
|
||||||
|
echo "$SECONDS, $(fc -ln -1), $?" >> time.log
|
||||||
|
}
|
||||||
|
|
||||||
|
##BASH SCRIPT GOES HERE
|
||||||
Reference in New Issue
Block a user