Skip to Content
Mastering Linux Shell Scripting - Second Edition
book

Mastering Linux Shell Scripting - Second Edition

by Mokhtar Ebrahim, Andrew Mallett
April 2018
Beginner
284 pages
7h 3m
English
Packt Publishing
Content preview from Mastering Linux Shell Scripting - Second Edition

Questions

  1. Suppose you have a file with the following content:
Hello, sed is a powerful editing tool. I love working with sedIf you master sed, you will be a professional one

And suppose you use the following command:

$ sed 's/Sed/Linux sed/g' myfile 

How many lines will be substituted?

  1. Suppose you have the same file that was used in the previous question and you use the following command:
$ sed '2d' myfile  

How many lines will be deleted from the file?

  1. What is the location of the inserted line in the following example?
$ sed '3a\Example text' myfile  
  1. Suppose you have the same previous sample file and you run the following command:
$ sed '2i\inserted text/w outputfile' myfile  

How many lines will be saved to the output file?

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Linux Shell Scripting - Second Edition

Learning Linux Shell Scripting - Second Edition

Ganesh Sanjiv Naik
Linux Shell Scripting Cookbook - Third Edition

Linux Shell Scripting Cookbook - Third Edition

Clif Flynt, Sarath Lakshman, Shantanu Tushar

Publisher Resources

ISBN: 9781788990554Supplemental Content