Quantcast
Channel: Write a program that read from a file and print the line with line number - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 4

Answer by jai_s for Write a program that read from a file and print the line with line number

$
0
0

You could use nl too --

nl -s. -ba file
     1.This is the first line
     2.This is the second line
     3.This is the third line
     4.
     5.This was a blank line

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>