Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is sed in shell script?

1029


What is the use of echo in shell script?

996


What is the purpose of scripting?

1059


Explain about the slow execution speed of shells?

1205


Determine the output of the following command: [ -z “” ] && echo 0 || echo 1

979


What is bash eval?

990


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 ?

2136


What is the syntax of "nested if statement" in shell scripting?

1082


What is a batch file used for?

1064


What is difference between shell and bash scripting?

973


What is inside a seashell?

1124


What will happen to my current process when I execute a command using exec?

1030


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.

2460


What is shell prompt?

1006


What does sh mean?

1038