Monday, May 30, 2011

sed quit operator and seq operator

The seq operator in shell is to generate sequential numbers.As you can see.


 acer@ubuntu:~$ seq 10
1
2
3
4
5
6
7
8
9
10
And the quit operator in sed is mainly used to quit when aa particular match or substitution occurs.


acer@ubuntu:~$ seq 10 | sed '4 q'
1
2
3
4
acer@ubuntu:~$

As you may see from the above example the ouput is stopped once the match occurs.

No comments:

Post a Comment