You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It was an ordinary grey autumn day in 1993. You came home from work at Hewlett-Packard, feeling a little tired. You had a small two-room apartment on the outskirts of N town. There was a low-alcohol drink in the refrigerator called "pivo". You took that drink and a bag of crackers then went to your little nook, to your computer made by Dell.
22
24
23
25
`*Click*` - the power button was pressed. A couple of minutes of boot loading and... yeah, it feels good. You always get that feeling when you turn on a computer. A few seconds of undisturbed pleasure and you opened
@@ -89,35 +91,43 @@ Cat is one of the most frequently used commands on Unix-like operating systems.
89
91
| 4 | -c | Output count of matching lines only. |
90
92
| 5 | -l | Output matching files only. |
91
93
| 6 | -n | Precede each matching line with a line number. |
92
-
| 7 | -b | A historical curiosity: precede each matching line with a block number. |
93
-
| 8 | -h | Output matching lines without preceding them by file names. |
94
-
| 9 | -s | Suppress error messages about nonexistent or unreadable files. |
95
-
| 10 | -f file | Take regexes from a file. |
96
-
| 11 | -o | Output the matched parts of a matching line. |
94
+
| 7 | -h | Output matching lines without preceding them by file names. |
95
+
| 8 | -s | Suppress error messages about nonexistent or unreadable files. |
96
+
| 9 | -f file | Take regexes from a file. |
97
+
| 10 | -o | Output the matched parts of a matching line. |
97
98
98
99
99
100
## Chapter III
100
101
101
102
- The programs must be developed in C language of C11 standard using gcc compiler.
102
103
- The program code must be located in the src folder
103
-
- The program must be built with Makefile with appropriate targets: s21_cat, s21_grep
104
+
- The programs must be executable files with command line arguments
105
+
- The programs must be built with Makefile with appropriate targets: s21_cat, s21_grep
104
106
- If third-party libraries are used, there must be build scripts in makefile to connect/load them
105
107
- Integration tests must cover all flag variants and input values, based on a comparison with the behavior of real Bash utilities
106
-
- The program must be developed according to the principles of structured programming
108
+
- The programs must be developed according to the principles of structured programming
107
109
- Code duplication must be avoided, common modules must be reused between the utilities
108
-
- You can use standard and non-standard C libraries or you can use your own developed libraries from other projects
110
+
- You can use standard and non-standard C libraries, or you can use your own developed libraries from other projects
109
111
110
112
## Part 1. Working with the cat utility
111
113
112
114
You need to develop a cat utility:
113
-
- Support all flags
115
+
- Support of all flags
114
116
- The source, header, and build files must be placed in the src/cat/ directory
115
117
- The resulting executable file must be placed in the directory src/cat/ and named s21_cat
116
118
117
119
## Part 2. Working with grep utility
118
120
119
121
You need to develop the grep utility:
120
-
- Support all flags
121
-
- You can use any library for regular expressions (e.g. pcre).
122
-
- The source, header and build files must be placed in the src/grep/ directory.
122
+
- Support of the following flags: -e, -i, -v, -c, -l, -n
123
+
- You can use any library for regular expressions (e.g. pcre)
124
+
- The source, header and build files must be placed in the src/grep/ directory
125
+
- The resulting executable file must be placed in the directory src/grep/ and named s21_grep
126
+
127
+
## Part 3. Bonus. Implementation of some grep utility flags
128
+
129
+
Bonus assignment for extra points. You need to develop the grep utility:
130
+
- Support of all flags, including: -h, -s, -f, -o
131
+
- You can use any library for regular expressions (e.g. pcre)
132
+
- The source, header and build files must be placed in the src/grep/ directory
123
133
- The resulting executable file must be placed in the directory src/grep/ and named s21_grep
0 commit comments