I want to make log_files named as log_Jan_01_hh:mm:ss, so the variable time-stamp is defined as date +%b_%d_%T.Now if I set the value to a variable:setenv now `date +%b_%d_%T`Then $now variable does get value update at that moment, so all the time log files have same name.How can I do something so that $now gets it value refreshed at every moment?
append time to log filenames
shell;date;tcsh
If you just store a string in $now, and add backticks when you invoke it, you get the current date:[~]% setenv now 'date +%b_%d_%T'[~]% echo $nowdate +%b_%d_%T[~]% echo `$now`Dec_03_13:09:52[~]% echo `$now`Dec_03_13:09:54This is effectively the same as doing:[~]% echo `date +%b_%d_%T`There is no way to tell tcsh to re-evaluate the command on invoking the variable; you assign a string to $now, and tcsh has no way of knowing what the command was that generated this string.Another (possible) solution might be using functions, but tcsh lacks those as well...