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 |
Explain about non-login shell files?
What does echo $0 do?
I want to upload a file to remote server through ftp daily.Can anyone suggest how to make a shell script for that.I hv credentials for that ftp
What language is shell scripting?
What are the different variables present in linux shell?
What is the default shell of solaris?
give me some website where i can get unix and testing meterials
What are the four fundamental components of every file system on linux?
What is a shell environment?
Why should we use shell scripts?
what are special characters and explain how does text varies by the usage of single quotes,double quotes and back quotes?
What is path variable bash?