Write a shell script that reads lines in a file and echo the line followed by the string “This line is line n” n=1, 2, 3…

Write a shell script that reads lines in a file and echo the line followed by the string “This line is line n” n=1, 2, 3…

Code:

clear
echo -------------------------------------------------
echo '\tNumbers for each line'
echo -------------------------------------------------
echo Enter the file name
read fname
sed = $fname | sed 'N;s/\n/\. /'

Output:

No comments

Powered by Blogger.