Hi
I am bit new to Linux.
Can anybody explain How this command works
Code:
$ awk '/./{line=$0} END{print line}' file1
I know the above command prints the last non empty line.
for ex:file1 has text as shown below.
Code:
PGW|PGW_CDR_|2017-06-23 141946|2017-07-17 131633|2017-08-21
PGW|PGW_CDR_|2017-06-23 141946|2017-07-17 131633|2017-08-21
PGW|PGW_CDR_|2017-06-23 141946|2017-07-17 131633|2017-08-21
PGW|PGW_CDR_|2017-06-23 141946|2017-07-17 131633|2017-08-21
PGW|PGW_CDR_|2017-06-23 141946|2017-07-17 131633|2017-08-21
Total number of rows: 5
last 2 lines in the file are empty lines.
and the above comand prints
Total number of rows: 5
Can anybody please decode the command and explain me.
Thanks