0

I need awk to print underscore in the output. see below example

Current Output

  [root@looct ~]# date | awk '{print $2$3$6}'
   Nov142016

Required Output

Nov_14_2016   -----> I need this, is it possible? 
0

2 Answers 2

6
date +%b_%d_%Y

will do it without an extra process.

3
 date | awk '{print $2"_"$3"_"$6}'

or with OFS

date | awk -v OFS=_ '{print $2,$3,$6}'

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.