|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
replacing the last occurence of a character in a line
Hi everybody
I know this sentence to replace the first occurrence of a comma in a line by a point: Code:
sed -e "s/,/./" but I want to replace just the last occurence of a comma in a line Can anyone tell me how? thanks in advance |
|
#2
|
|||
|
|||
|
echo 'abc,def,12379,foo' | sed 's/\(.*\),/\1./'
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > replacing the last occurence of a character in a line |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|