Use sed to replace a single letter?
I cant seem to get sed to replace a single letter, when i use
Code:
sed -e 's/J/M/g' The data looks like lastname:firstname:middlename Quote:
Quote:
|
The g makes it global (for all instances in the line). If you remove the g then only the first instance will be changed:
Code:
sed 's/J/M/' Code:
sed 's/J/M/2' Code:
sed 's/J$/M/' - sed, a stream editor |
^ as above. The /g makes it do it multiple times for every instance in a line. Drop the g and it does the first instance only.
|
Quote:
Code:
sed 's/\<J\>/M/g' |
All times are GMT -5. The time now is 10:04 AM. |