Skip to content

Instantly share code, notes, and snippets.

@Pablo-Leon
Last active May 16, 2016 13:36
Show Gist options
  • Save Pablo-Leon/fc27fe2ae439a82ec0c4abcf2e6bb41e to your computer and use it in GitHub Desktop.
Save Pablo-Leon/fc27fe2ae439a82ec0c4abcf2e6bb41e to your computer and use it in GitHub Desktop.
Base shell
#!/bin/sh
sProg=`basename $0`
sTimestamp=`date '+%y%m%d-%H%M'`
sLogfile="log/${sProg}.${sTimestamp}.log"
if [ ! -d log ]; then mkdir log; fi
{
echo "======================"
echo "BEGIN($sProg): `date`"
echo "----------------------"
hostname;id;pwd
# Body
echo "END($sProg): `date`"
echo "......................"
} 2>&1 | tee -a $sLogfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment