Re: How to create a formatted timestamp and use it in filename in a script?
From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 01/29/05
- Next message: snowcrash27_at_hotmail.com: "while [...] && [...] this doesn't work"
- Previous message: sf_94133_at_yahoo.com: "sed question"
- In reply to: Ulf Meinhardt: "How to create a formatted timestamp and use it in filename in a script?"
- Next in thread: nasirmahmood_at_sat.net.pk: "Re: How to create a formatted timestamp and use it in filename in a script?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 28 Jan 2005 21:47:20 -0500
In article <cteiro$an4$03$1@news.t-online.com>,
ulf2m@email.com (Ulf Meinhardt) wrote:
> I want to
> 1.) get the current timestamp (including milliseconds !)
> 2.) format it according to usual options and finally
> 3.) create a filename from it
>
> All together it should be similar to:
>
> myts=getTimestamp(dd.MM.yyyy_HH:mm:ss:ms)
> myfilename=aaa_{$ts}.log
>
> How do I do this in unix shell script ?
man date
and notice the +<format> option.
-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***
- Next message: snowcrash27_at_hotmail.com: "while [...] && [...] this doesn't work"
- Previous message: sf_94133_at_yahoo.com: "sed question"
- In reply to: Ulf Meinhardt: "How to create a formatted timestamp and use it in filename in a script?"
- Next in thread: nasirmahmood_at_sat.net.pk: "Re: How to create a formatted timestamp and use it in filename in a script?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|