Therefore, I need to convert the date to a different format. With the bash pipeline, I take the date from the last login to the console and pull the corresponding bits with awk, for example:
last $USER | grep console | head -1 | awk '{print $4, $5}'
Which outputs: Aug 08 ($ 4 = Aug $ 5 = 08, in this case.)
Now I want to take "August 08" and put it in the date command to change the format to a numeric date.
Which would look something like this:
date -j -f %b\ %d Aug\ 08 +%m-%d
Outputs: 08-08
I have a question: how to add this to my pipeline and use the awk variables $ 4 and $ 5, where is βAugust 08β in this date command?
snk
source share