Skip to content

Commit 73fa7fe

Browse files
author
Administrator
committed
Update from 10
1 parent b826817 commit 73fa7fe

File tree

5 files changed

+46
-26
lines changed

5 files changed

+46
-26
lines changed

README.md

+22-12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ The russian version of the task can be found in the repository.
1818

1919
## Preamble
2020

21+
![simple_bash_utils](misc/eng/images/bashutils.png)
22+
2123
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.
2224

2325
`*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.
8991
| 4 | -c | Output count of matching lines only. |
9092
| 5 | -l | Output matching files only. |
9193
| 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. |
9798

9899

99100
## Chapter III
100101

101102
- The programs must be developed in C language of C11 standard using gcc compiler.
102103
- 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
104106
- If third-party libraries are used, there must be build scripts in makefile to connect/load them
105107
- 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
107109
- 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
109111

110112
## Part 1. Working with the cat utility
111113

112114
You need to develop a cat utility:
113-
- Support all flags
115+
- Support of all flags
114116
- The source, header, and build files must be placed in the src/cat/ directory
115117
- The resulting executable file must be placed in the directory src/cat/ and named s21_cat
116118

117119
## Part 2. Working with grep utility
118120

119121
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
123133
- The resulting executable file must be placed in the directory src/grep/ and named s21_grep

README_RUS.md

+24-14
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
## Preamble
1818

19+
![simple_bash_utils](misc/rus/images/bashutils.png)
20+
1921
То был обычный серый осенний день 1993 года. Вы пришли домой со своей работы в Hewlett-Packard,
2022
немного уставший. У вас была небольшая двухкомнатная квартира на окраинах города N,
2123
а в холодильнике был слабоалкогольный напиток под названием pivo. Вы взяли этот напиток,
@@ -86,22 +88,22 @@ grep впервые был включен в Версию 4 Unix. Заявив,
8688
|| Опции | Описание |
8789
| ------ | ------ | ------ |
8890
| 1 | -e | Шаблон |
89-
| 2 | -i | Игнорирует различия регистра |
90-
| 3 | -v | Инвертирует смысл поиска соответствий |
91+
| 2 | -i | Игнорирует различия регистра. |
92+
| 3 | -v | Инвертирует смысл поиска соответствий. |
9193
| 4 | -c | Выводит только количество совпадающих строк. |
92-
| 5 | -l | Выводит только совпадающие файлы |
93-
| 6 | -n | Предваряет каждую строку вывода номером строки из файла ввода |
94-
| 7 | -b | Исторический курьез: Печатает перед каждой совпадающей строкой вывода номер блока. |
95-
| 8 | -h | Выводит совпадающие строки, не предваряя их именами файлов |
96-
| 9 | -s | Подавляет сообщения об ошибках о несуществующих или нечитаемых файлах. |
97-
| 10 | -f file | Получает регулярные выражения из файла. |
98-
| 11 | -o | Печатает только совпадающие (непустые) части совпавшей строки |
94+
| 5 | -l | Выводит только совпадающие файлы. |
95+
| 6 | -n | Предваряет каждую строку вывода номером строки из файла ввода. |
96+
| 7 | -h | Выводит совпадающие строки, не предваряя их именами файлов. |
97+
| 8 | -s | Подавляет сообщения об ошибках о несуществующих или нечитаемых файлах. |
98+
| 9 | -f file | Получает регулярные выражения из файла. |
99+
| 10 | -o | Печатает только совпадающие (непустые) части совпавшей строки. |
99100

100101

101102
## Chapter III
102103

103104
- Программы должны быть разработаны на языке Си стандарта C11 с использованием компилятора gcc
104-
- Код программ должен находиться в папке src
105+
- Код программ должен находиться в папке src
106+
- Программы должны представлять собой исполняемый файл с аргументами командной строки
105107
- Сборка программ должна быть настроена с помощью Makefile с соответствующими целями: s21_cat, s21_grep
106108
- Если используются сторонние библиотеки, в Makefile должны быть заложены сценарии сборки, предусматривающие их подключение / загрузку
107109
- Необходимо покрытие интеграционными тестами для всех вариантов флагов и входных значений, на базе сравнения с поведением реальных утилит Bash
@@ -113,13 +115,21 @@ grep впервые был включен в Версию 4 Unix. Заявив,
113115

114116
Необходимо разработать утилиту cat:
115117
- Поддержка всех флагов
116-
- Исходные, заголовочные и сборочный файлы должны распологаться в директории src/cat/
118+
- Исходные, заголовочные и сборочный файлы должны располагаться в директории src/cat/
117119
- Итоговый исполняемый файл должен располагаться в директории src/cat/ и называться s21_cat
118120

119121
## Part 2. Работа с утилитой grep
120122

121123
Необходимо разработать утилиту grep:
122-
- Поддержка всех флагов
123-
- Для регулярных выражений можно использовать любую библиотеку (например, pcre).
124-
- Исходные, заголовочные и сборочный файлы должны распологаться в директории src/grep/
124+
- Поддержка следующих флагов: -e, -i, -v, -c, -l, -n
125+
- Для регулярных выражений можно использовать любую библиотеку (например, pcre)
126+
- Исходные, заголовочные и сборочный файлы должны располагаться в директории src/grep/
127+
- Итоговый исполняемый файл должен располагаться в директории src/grep/ и называться s21_grep
128+
129+
## Part 3. Дополнительно. Реализация некоторых флагов утилиты grep
130+
131+
Необязательное задание на дополнительные баллы. Необходимо разработать утилиту grep:
132+
- Поддержка всех флагов, включая: -h, -s, -f, -o.
133+
- Для регулярных выражений можно использовать любую библиотеку (например, pcre)
134+
- Исходные, заголовочные и сборочный файлы должны располагаться в директории src/grep/
125135
- Итоговый исполняемый файл должен располагаться в директории src/grep/ и называться s21_grep

misc/eng/images/bashutils.png

492 KB
Loading

misc/images/.gitkeep

Whitespace-only changes.

misc/rus/images/bashutils.png

492 KB
Loading

0 commit comments

Comments
 (0)