hi..
i am new to here. can anybody tell me how can we change the date format in the 'last' command.
EX- on running last command i am getting --
rruat pts/12 172.18.40.101 Tue May 3 12:59 still logged in
rruat pts/10 blr2-3f-239.asco Tue May 3 12:59 - 13:09 (00:10)
desired output should be
rruat pts/12 172.18.40.101 Tue 05 3 12:59 still logged in
rruat pts/10 blr2-3f-239.asco Tue 05 3 12:59 - 13:09 (00:10)
thanks in advance
arpit
last | awk 'BEGIN{a["Jan"]="01"; a["Feb"]="02"; ...add other months here}NF==10{$5=a[$5]}NF==9{$6=a[$6]} 1'
You will have to modify a little bit the above script to make it work.
hi
thanks or the reply..but my question is- is there any switch avaliable for the last command to change the date format.
actually the real problem is --
file 'temp' contains the data of last command.
now i am reading the file through while loop. and want to display only those lines which have date >= todays' date.
i want to do this by using awk. plese tell if you have any idea on this.
thanks