-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchar_stream.tush
54 lines (45 loc) · 981 Bytes
/
char_stream.tush
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
$ cd "$MYDIR"; printf '' | $AWK -f char_stream.awk -f char_stream_test.awk
$ cd "$MYDIR"; printf 'a' | $AWK -f char_stream.awk -f char_stream_test.awk
| [a]
$ cd "$MYDIR"; printf '\n' | $AWK -f char_stream.awk -f char_stream_test.awk
$ cd "$MYDIR"; printf '\n\n' | $AWK -f char_stream.awk -f char_stream_test.awk
| [
| ]
# Awk is not able to distinguish 'a' vs 'a\n' inputs, so let's parse 2 as 1
$ cd "$MYDIR"; printf 'a\n' | $AWK -f char_stream.awk -f char_stream_test.awk
| [a]
$ cd "$MYDIR"; printf '\na' | $AWK -f char_stream.awk -f char_stream_test.awk
| [
| ]
| [a]
$ cd "$MYDIR"; printf 'a\nb' | $AWK -f char_stream.awk -f char_stream_test.awk
| [a]
| [
| ]
| [b]
$ cd "$MYDIR"; printf 'a\n\nb' | $AWK -f char_stream.awk -f char_stream_test.awk
| [a]
| [
| ]
| [
| ]
| [b]
$ cd "$MYDIR"; printf '\naaa\nb cc\nddddd\n' | $AWK -f char_stream.awk -f char_stream_test.awk
| [
| ]
| [a]
| [a]
| [a]
| [
| ]
| [b]
| [ ]
| [c]
| [c]
| [
| ]
| [d]
| [d]
| [d]
| [d]
| [d]