`sed' is a stream editor
Sed is the ultimate stream editor.
If that sounds strange, picture a stream flowing through a pipe.
Okay, you can't see a stream if it's inside a pipe.
That's what I get for attempting a flowing analogy.
You want literature, read James Joyce.
Examples:-
[root@rhel6 rajesh]# echo day
day
[root@rhel6 rajesh]# echo day | sed s/day/night/
night
[root@rhel6 rajesh]# echo "This is my data.." | sed s/my/your/
This is your data..
[root@rhel6 rajesh]#
[root@rhel6 rajesh]# echo EVERYDAY | sed 's/day/night/'
EVERYDAY
[root@rhel6 rajesh]#
[root@rhel6 rajesh]# echo EVERYDAY | sed 's/day/night/i' //"i" switch to ignore case-sentivity
EVERYnight
[root@rhel6 rajesh]# echo "one two three, one two three four three two one one hundred" | sed 's/one/ONE/'
ONE two three, one two three four three two one one hundred
[root@rhel6 rajesh]# echo "one two three, one two three four three two one one hundred" | sed 's/one/ONE/g' //"g" switch to make changes global
ONE two three, ONE two three four three two ONE ONE hundred
[root@rhel6 rajesh]#
Will try to update as and often i get more details ;-)
Examples:-
[root@rhel6 rajesh]# echo day
day
[root@rhel6 rajesh]# echo day | sed s/day/night/
night
[root@rhel6 rajesh]# echo "This is my data.." | sed s/my/your/
This is your data..
[root@rhel6 rajesh]#
[root@rhel6 rajesh]# echo EVERYDAY | sed 's/day/night/'
EVERYDAY
[root@rhel6 rajesh]#
[root@rhel6 rajesh]# echo EVERYDAY | sed 's/day/night/i' //"i" switch to ignore case-sentivity
EVERYnight
[root@rhel6 rajesh]# echo "one two three, one two three four three two one one hundred" | sed 's/one/ONE/'
ONE two three, one two three four three two one one hundred
[root@rhel6 rajesh]# echo "one two three, one two three four three two one one hundred" | sed 's/one/ONE/g' //"g" switch to make changes global
ONE two three, ONE two three four three two ONE ONE hundred
[root@rhel6 rajesh]#
Will try to update as and often i get more details ;-)
Comments
Post a Comment