Stream Editor - Pattern Buffer


The basic operation that we perform on any file displays its contents. So we can print the command that prints the content of pattern buffer.

\\Now we are creating a file containing line number, book name, its author.
$ vi lfc.txt 
1) The Shadow of the Wind,  Carlos Ruiz Zafón
2) One Hundred Years of Solitude,  Gabriel García Márquez 
3) The Little Prince ,  Antoine de Saint
4) The Alchemist, Paulo Coelho 
----------------------------------------------
----------------------------------------------
\\let us print the file contents.
$ sed 'p' lfc.txt
1) The Shadow of the Wind,  Carlos Ruiz Zafón
1) The Shadow of the Wind,  Carlos Ruiz Zafón
2) One Hundred Years of Solitude,  Gabriel García Márquez 
2) One Hundred Years of Solitude,  Gabriel García Márquez 
3) The Little Prince ,  Antoine de Saint
3) The Little Prince ,  Antoine de Saint
4) The Alchemist, Paulo Coelho 
4) The Alchemist, Paulo Coelho 

As you have seen, each line is printed twice. If you remember the workflow of SED then by default, SED prints the contents of the pattern buffer and we also include the print command so that the content prints twice.

So if we use the -n option, the content will not be printed twice due to suppress the default printing of the pattern buffer.

$ sed -n 'p' lfc.txt 
1) The Shadow of the Wind,  Carlos Ruiz Zafón
2) One Hundred Years of Solitude,  Gabriel García Márquez 
3) The Little Prince ,  Antoine de Saint
4) The Alchemist, Paulo Coelho 





Visit :


Discussion



* You must be logged in to add comment.

pHqghUme
555

pHqghUme
555

pHqghUme
555

pHqghUme
-1 OR 2+635-635-1=0+0+0+1 --

pHqghUme
-1 OR 3+635-635-1=0+0+0+1 --

pHqghUme
-1 OR 3*2<(0+5+635-635) --

pHqghUme
-1 OR 3*2>(0+5+635-635) --

pHqghUme
-1 OR 2+318-318-1=0+0+0+1

pHqghUme
-1 OR 3+318-318-1=0+0+0+1

pHqghUme
-1 OR 3*2<(0+5+318-318)

pHqghUme
-1 OR 3*2>(0+5+318-318)

pHqghUme
-1' OR 2+259-259-1=0+0+0+1 --

pHqghUme
-1' OR 3+259-259-1=0+0+0+1 --

pHqghUme
-1' OR 3*2<(0+5+259-259) --

pHqghUme
-1' OR 3*2>(0+5+259-259) --

pHqghUme
-1' OR 2+541-541-1=0+0+0+1 or 'hJ4dgxgB'='

pHqghUme
-1' OR 3+541-541-1=0+0+0+1 or 'hJ4dgxgB'='

pHqghUme
-1' OR 3*2<(0+5+541-541) or 'hJ4dgxgB'='

pHqghUme
-1' OR 3*2>(0+5+541-541) or 'hJ4dgxgB'='

pHqghUme
-1" OR 2+504-504-1=0+0+0+1 --

pHqghUme
-1" OR 3+504-504-1=0+0+0+1 --

pHqghUme
-1" OR 3*2<(0+5+504-504) --

pHqghUme
-1" OR 3*2>(0+5+504-504) --

pHqghUme
if(now()=sysdate(),sleep(15),0)

pHqghUme
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z

pHqghUme
0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z

pHqghUme
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/

pHqghUme
-1; waitfor delay '0:0:15' --

pHqghUme
-1); waitfor delay '0:0:15' --

pHqghUme
1 waitfor delay '0:0:15' --

pHqghUme
48wQPQOa'; waitfor delay '0:0:15' --

pHqghUme
-5 OR 589=(SELECT 589 FROM PG_SLEEP(15))--

pHqghUme
-5) OR 240=(SELECT 240 FROM PG_SLEEP(15))--

pHqghUme
-1)) OR 519=(SELECT 519 FROM PG_SLEEP(15))--

pHqghUme
ZuRRQSGo' OR 171=(SELECT 171 FROM PG_SLEEP(15))--

pHqghUme
cueauglz') OR 837=(SELECT 837 FROM PG_SLEEP(15))--

pHqghUme
kcwzU37D')) OR 159=(SELECT 159 FROM PG_SLEEP(15))--

pHqghUme
555*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)

pHqghUme
555'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'

pHqghUme
1'"

pHqghUme

pHqghUme
@@0LwlO

pHqghUme
555

pHqghUme
555

pHqghUme
555