Define the variable ${NOW}:
NOW=`date +"%Y%m%d-%H%M%S"`If we invoke this as in this example:
netstat -an >> /logs/netstat.out.${NOW}
It will create a datestamp that looks like the following:
netstat.out.20051029-124116
Providing uninformed opinions on Politics, Economics, and Geek stuff, so you don't have to.
NOW=`date +"%Y%m%d-%H%M%S"`If we invoke this as in this example:
netstat -an >> /logs/netstat.out.${NOW}
netstat.out.20051029-124116
No comments:
Post a Comment