Thursday, July 15, 2010

sed command - 's' for Subtitution.

--------------------------------
The most useful `sed` utility is s i think. ie subtitution.

Here is one example.

1)
+$ echo "dim" | sed s/dim/light/
light
+$

if the syntax is wrong;

+$ echo "dim" | sed s/dim/light
sed: command garbled: s/dim/light

2)

+$ cat file1
boy

+$ sed s/boy/girl/ file1 > file2

+$ cat file2
girl

---------------------------------------------------

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.