| | |
backreferencing in sed
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
sed 's/string1/string2/' replaces string1 with string2. the 's' signifies the substitution.
you are grouping the letters 'abc' i.e. (abc) using \(abc\) using the \ to escape the literal interpretation of the parenthesis.
The asterisk is used to signify one or more occurences of the group 'abc'.
It is the reason you are getting a single 'xyz' as the output.
type the same without the asterisk to see the change in output.
Hope it helps!
![]() |
Other Threads in the Shell Scripting Forum
- Previous Thread: Command Menu Shell Script Help
- Next Thread: print one liners
| Thread Tools | Search this Thread |
Tag cloud for Shell Scripting





