log path to log log echo date log elog echo log enlog echo -n log

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
log="path/to/log"
log () {
echo "[$(date)] $@" >> ${log}
}
elog (){
echo "$@"
log "$@"
}
enlog (){
echo -n "$@"
log "$@"
}