-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
40 lines (33 loc) · 862 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Quick sample
$ cat emails.txt
$ cat emails.txt| sed 's#@.*##'
user
otheruser
$ cat emails.txt | ./sedsed -d --hide=hold 's#@.*##'
PATT:[email protected]$
COMM:s#@.*##
PATT:user$
user
PATT:[email protected]$
COMM:s#@.*##
PATT:otheruser$
otheruser
The -d option turns debug ON.
The --hide=hold options hides the HOLD SPACE buffer contents, because it is always empty on this example.
The PATT: lines on sedsed's output shows the PATTERN SPACE buffer contents.
The COMM: yellow lines show the command which is being executed.
The user and otheruser lines are the sed's normal output.
The $ sign at the end of PATT: lines represent the end of the buffer.
Indent
$ cat email-linker.sed
h;s|.*|<link>&<link>|;x;/@/{s/@.*/'s email:/;G;}
$ ./sedsed --indent -f email-linker.sed
h
s|.*|<link>&<link>|
x
/@/ {
s/@.*/'s email:/
G
}