-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrep.sh
28 lines (19 loc) · 976 Bytes
/
grep.sh
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
#!/bin/bash
echo "Test 'pattern + file'"
diff <(./grep and test1.txt) <(grep and test1.txt)
echo "Test 'e + pattern + file'"
diff <(./grep -e and test1.txt) <(grep -e and test1.txt)
echo "Test 'e + pattern + e + pattern + file'"
diff <(./grep -e and -e several test1.txt) <(grep -e and -e several test1.txt)
echo "Test 'e + pattern + e + pattern + two files'"
diff <(./grep -e and -e several test1.txt test2.txt) <(grep -e and -e several test1.txt test2.txt)
echo "Test 'i + pattern + file'"
diff <(./grep -i aNd test1.txt) <(grep -i aNd test1.txt)
echo "Test 'v + pattern + file'"
diff <(./grep -v and test1.txt) <(grep -v and test1.txt)
echo "Test 'c + pattern + file'"
diff <(./grep -c and test1.txt) <(grep -c and test1.txt)
echo "Test 'l + pattern + two files'"
diff <(./grep -l and test1.txt test2.txt) <(grep -l and test1.txt test2.txt)
echo "Test 'n + pattern + two files'"
diff <(./grep -n several test1.txt test2.txt) <(grep -n several test1.txt test2.txt)