Monday, November 15, 2010

"\1" pierwszy zapamiętany wzorzec

grzesiek@home:~$ echo "ABCD" | sed -r 's/(.)/  \1/g'
  A  B  C  D
grzesiek@home:~$ echo "ABCD" | sed -r 's/(.)/\1 /g'
A B C D
grzesiek@home:~$ echo "ABCD" | sed  -r 's/(.)([ABCD])/\1 -\2/g'
A -BC -D




http://www.linuxquestions.org/questions/programming-9/how-to-insert-characters-into-a-string-in-shellscripts-844413/
http://www.grymoire.com/Unix/Sed.html#uh-4
http://www.regular-expressions.info/

No comments:

Post a Comment