SlideShare a Scribd company logo
Write a shell command to substitute the first Nick to John in report.txt and save the result to
report_new.txt
Solution
By default sed uses stdout, so shell's redirect operator is to be used, as in our example below.
This is a most simple example, but we illustrated a few points: we match the pattern "Nick" and
we substitute all instances with "John". Note that sed is case-sensitive.
$ sed 's/Nick/John/g' report.txt > report_new.txt

More Related Content

PDF
Why did the European empires in the Americas have such an enormously.pdf
PDF
What were the unintended consequences of the Cuban Missile Crisis.pdf
PDF
What process occurs when bile is mixed with fats How does this proc.pdf
PDF
What is OBDC , Is it a program and what is the difference between .pdf
PDF
This Capital includes O A. mineral resources. O B. the money in one.pdf
PDF
What are the essential characteristics of cloud computingSolutio.pdf
PDF
We live in a very complex and culturally diverse society. When we br.pdf
PDF
What are the values of the following expressions, assuming that n is.pdf
Why did the European empires in the Americas have such an enormously.pdf
What were the unintended consequences of the Cuban Missile Crisis.pdf
What process occurs when bile is mixed with fats How does this proc.pdf
What is OBDC , Is it a program and what is the difference between .pdf
This Capital includes O A. mineral resources. O B. the money in one.pdf
What are the essential characteristics of cloud computingSolutio.pdf
We live in a very complex and culturally diverse society. When we br.pdf
What are the values of the following expressions, assuming that n is.pdf

More from lakshmijewellery (20)

PDF
True or FalseA budget variance is the difference between expected.pdf
PDF
This level of measurement includes continuous measures A. Nominal; .pdf
PDF
Throughout the middle ages European philosophers believed in…a sci.pdf
PDF
The term intangible assets is used in accounting to denotea. suc.pdf
PDF
The methyl-accepting chemotaxis proteins of bacteriaa) integrate m.pdf
PDF
The lagging strand is replicated with a series of Okazaki fragments .pdf
PDF
The files etcpasswd and etcshadow can be manually edited. Why wo.pdf
PDF
The dividends received deduction Must exceed the applicable percentag.pdf
PDF
The chordae tendinae of the AV valves are anchored to the ___ of the .pdf
PDF
Read the case Kenny An Effective Supervisor and in a 2-3 page p.pdf
PDF
Q4. How are automated tools used in the maintenance of information .pdf
PDF
PLEASE PLEASE use your OWN words, DO NOT copy and paste please expla.pdf
PDF
Nuclear Tree Focus on the relationships (monophyly, sister groups, .pdf
PDF
Marine flowering plants produce. a sporophyte a gametophyte tetr.pdf
PDF
How important is Logistics Support Analysis to the ILS process Brie.pdf
PDF
how to play .wav files in a java program on multiple devices!!! For .pdf
PDF
Identify the major provisions of the Affordable Care Act that will h.pdf
PDF
I have a simple TCP clientserver socket set up in Python. How can I.pdf
PDF
Find the effective rate corresponding to the given nominal rate. (Ro.pdf
PDF
C++ AssignmentPlease read all the requirements and the overloading.pdf
True or FalseA budget variance is the difference between expected.pdf
This level of measurement includes continuous measures A. Nominal; .pdf
Throughout the middle ages European philosophers believed in…a sci.pdf
The term intangible assets is used in accounting to denotea. suc.pdf
The methyl-accepting chemotaxis proteins of bacteriaa) integrate m.pdf
The lagging strand is replicated with a series of Okazaki fragments .pdf
The files etcpasswd and etcshadow can be manually edited. Why wo.pdf
The dividends received deduction Must exceed the applicable percentag.pdf
The chordae tendinae of the AV valves are anchored to the ___ of the .pdf
Read the case Kenny An Effective Supervisor and in a 2-3 page p.pdf
Q4. How are automated tools used in the maintenance of information .pdf
PLEASE PLEASE use your OWN words, DO NOT copy and paste please expla.pdf
Nuclear Tree Focus on the relationships (monophyly, sister groups, .pdf
Marine flowering plants produce. a sporophyte a gametophyte tetr.pdf
How important is Logistics Support Analysis to the ILS process Brie.pdf
how to play .wav files in a java program on multiple devices!!! For .pdf
Identify the major provisions of the Affordable Care Act that will h.pdf
I have a simple TCP clientserver socket set up in Python. How can I.pdf
Find the effective rate corresponding to the given nominal rate. (Ro.pdf
C++ AssignmentPlease read all the requirements and the overloading.pdf

Recently uploaded (20)

PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Institutional Correction lecture only . . .
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Presentation on HIE in infants and its manifestations
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
Lesson notes of climatology university.
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Institutional Correction lecture only . . .
Final Presentation General Medicine 03-08-2024.pptx
2.FourierTransform-ShortQuestionswithAnswers.pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Final Presentation General Medicine 03-08-2024.pptx
Presentation on HIE in infants and its manifestations
A systematic review of self-coping strategies used by university students to ...
human mycosis Human fungal infections are called human mycosis..pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Lesson notes of climatology university.
Microbial diseases, their pathogenesis and prophylaxis
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025

Write a shell command to substitute the first Nick to John in report.pdf

  • 1. Write a shell command to substitute the first Nick to John in report.txt and save the result to report_new.txt Solution By default sed uses stdout, so shell's redirect operator is to be used, as in our example below. This is a most simple example, but we illustrated a few points: we match the pattern "Nick" and we substitute all instances with "John". Note that sed is case-sensitive. $ sed 's/Nick/John/g' report.txt > report_new.txt