How would you replace the n character in a file with some
xyz?
Answer Posted / seshadri sethi
sed ’s/n/xyz/g’ filename > new_filename
We can replace n characters by using the following command:
1,$s/./xyz/g
where 1 shows that the search string will start searching
patterns from first line of the file.
‘.’ for any character.
g for global replacemet.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is sed in shell script?
What is the use of echo in shell script?
What is the purpose of scripting?
Explain about the slow execution speed of shells?
Determine the output of the following command: [ -z “” ] && echo 0 || echo 1
What is bash eval?
Set up a Sev 2 alert when the Primary WA service fails. A windows batch script needs to be created that will monitor the WA service on the Primary and when the service stops/fails a Sev 2 TT is generated for a particular team ?
What is the syntax of "nested if statement" in shell scripting?
What is a batch file used for?
What is difference between shell and bash scripting?
What is inside a seashell?
What will happen to my current process when I execute a command using exec?
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.
What is shell prompt?
What does sh mean?