How would you replace the n character in a file with some
xyz?
Answers were Sorted based on User's Feedback
Answer / ram
* sed 's/n/xyz/g' filename > new_filename
s -search and replace
n -character to be replaced
xyz - character to replace
g -global
* vi filename
:%s/n/xyz/g --search and replace
:w! ---save
Is This Answer Correct ? | 8 Yes | 0 No |
Answer / 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 |
Answer / suresh raju
sed 's/.\{1,75\}/xyz/g' filename
here n=75. so 75 characters will be replaced with xyz
Is This Answer Correct ? | 1 Yes | 0 No |
What is shell environment?
Is bash an operating system?
Is powershell a language?
how to print the 2-d, 3-d arrays in unix shell script programs please answer thi questio to my mail venusaikumar@gmail.com
Script S1 (which copies .dat files from one directory1 to another directory2) run continuously. Write Script S2 which kills S1 first, compresses all .dat files in directory1 and directory2 successfully, re-run Script S1 and stops self i.e. S2.
Determine the output of the following command: [ -z “” ] && echo 0 || echo 1
What does it mean to debug a script?
Write a shell script in Linux to shift all characters in a file forward by five characters. (Thus “a” becomes “f’”).
2 Answers Ignou, Tripura Info,
State the advantages of shell scripting?
c program which accept one argument as a directory name and prints all the file name along with its inode number and total count of the file in directory
What are the advantages of shell script?
Why should we use shell scripts?