touch filename-`date '+%Y-%m-%d'` creates a file: filename-2009-05-06 touch filename-`date +"%Y%m%d%H%M%S"` creates a file: filename-20090506142053 touch filename- `date +"%Y%m%d%H%M%S"` creates a file: filename-2009-05-06-152446 touch filename-`date +"%Y-%m-%d-%H:%M:%S"` creates a file: filename-2009-05-06-15:36:36
alias cdate 'date +"%Y-%m-%d-%H:%M:%S"'
Then you call it as follows:
touch filename-`cdate`
You can also set this to a Unix variable as follows:
setenv cdate `date +"%Y-%m-%d-%H:%M:%S"`
You can use it as follows:
touch filename-$cdate
No comments:
Post a Comment