Re: awk print system date and time
On May 8, 7:46 pm, pk <p...@pk.invalid> wrote:
> On Thursday 8 May 2008 13:41, Ed Morton wrote:
>
> > On 5/8/2008 2:18 AM, moonhkt wrote:
> >> Hi All
> >> I am using awk for reformat vmstat data.
> >> Do you know to print system date and time
>
> >> my outout as below. the the time value no change ? Always
> >> 20080508_151351 in below session
>
> > What makes you think your command takes more than 1 second to run?
>
> He's running "vmstat 2 20" which outputs a line every two seconds, and pipes
> the output to awk.
>
> --
> All the commands are tested with bash and GNU tools, so they may use
> nonstandard features. I try to mention when something is nonstandard (if
> I'm aware of that), but I may miss something. Corrections are welcome.
I think dt="'`date +%Y%m%d_%H%M%S`'" will get the current time.
|