putting date into file name

Frank Price fprice at hawaii.edu
Thu Feb 28 18:39:25 PST 2002


Try this:

grep foo > "foo_`date`.txt"

works on my machine in bash, I think it works in other shells as well,
at least tcsh.
Make sure you use the backquote (`) and not
the single quote (').  The backquote encloses commands
to be evaluated before using the string.  This allow the output from any 
executable to be used as text on the command line.

Hope it helps.
fp

On Thursday 28 February 2002 14:06 pm, you wrote:
> A _long_ time ago someone here told me how to do this.  Can't find it in
> the list archives.
>
> How would I put a given day's date into a file name during a script?
>
> e.g.: grep foo > foo_<date>.log
>
> much thanks-
> rg
>
>
> ---
> You are currently subscribed to luau as: fprice at hawaii.edu
> To unsubscribe send a blank email to $subst('Email.Unsub')



More information about the LUAU mailing list