Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Shell/Exams/Pipes/2023-CE-01.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Напишете серия от команди, която извежда пътищата до всички файлове (из цялата файлова система),
# чиито собственик е текущият потребител и имат име, завършващо на .blend<число>.

# Примерен изход:
# /home/students/ivan/scenes/landscape.blend1
# /home/students/ivan/scenes/landscape.blend26
# /home/students/ivan/scenes/landscape.blend42
# /home/students/ivan/.local/share/Trash/lewd.blend1
# /tmp/baba.blend5

find / -type f -user $(whomai) 2>/dev/null | grep ".blend\[0-9]*$"
13 changes: 13 additions & 0 deletions Shell/Exams/Pipes/2023-CE-02.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#Разполагате с директория /var/log/my_logs, в която се намират log файлове. Log файл представлява
#обикновен файл, чието име има следния вид:
#<server_name>_<unix_timestamp>.log
#Името на сървър (s e r v e r _ n a m e ) може да съдържа букви, цифри и долни черти. Unix timestamp е число,
#означаващо брой изминали секунди след полунощ на първи януари 1970.
#Считаме, че файловете в тази директория, чиито имена нямат този формат, не са log файлове.
#Пример за име:
#correlator_1692117813.log
#Напишете серия от команди, намираща общия брой на срещанията на думата error във всички log
#файлове.

find /var/log/my_logs -type f -name "^[a-zA-Z_][a-zA-Z_]*_[0-9][0-9]*\.log$" -exec cat {} \; | grep -o "error" | wc -l

5 changes: 3 additions & 2 deletions Shell/Exams/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
|12|2020-SE-01|[Solution](<./Pipes/2020-SE-01.sh>)|
|13|2020-SE-02|[Solution](<./Pipes/2020-SE-02.sh>)|
|14|2022-CE-01|[Solution](<./Pipes/2022-CE-01.sh>)|
|15|2023-CE-01|MISSING|
|15|2023-CE-01|[Solution](<./Pipes/2023-CE-01.sh>)|
|16|2016-SE-01|[Solution](<./Pipes/2016-SE-01.sh>)|
### Scripts

|Task no.|Task id|Solution|
|---|---|---|
|16|2016-SE-01|[Solution](<./Scripts/2016-SE-01.sh>)|
|17|2016-SE-02|[Solution](<./Scripts/2016-SE-02.sh>)|
|18|2016-SE-03|[Solution](<./Scripts/2016-SE-03.sh>)|
|19|2016-SE-03|[Solution](<./Scripts/2016-SE-03.sh>)|
Expand Down Expand Up @@ -73,6 +73,7 @@
|59|2023-SE-02|MISSING|
|60|2023-SE-03|MISSING|
|61|2023-SE-04|MISSING|
|62|2016-SE-01|[Solution](<./Scripts/2016-SE-01.sh>)|
### Semaphores

|Task no.|Task id|Solution|
Expand Down
1 change: 1 addition & 0 deletions Shell/Exercises/Pipes/03-b-8500.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ cat /etc/group | cut -d ':' -f 1 | sed -E 's/^.*$/Hello, &/'
#or
cat /etc/group | awk -F ':' '{print "Hello, " $1}'
#or

cat /etc/group | cut -d ':' -f 3 | awk -v user_group_id=$(id -g) '$1 == user_group_id { print "Hello " $1 " - I am here!" } $1 != user_group_id { print "Hello " $1 }'
4 changes: 2 additions & 2 deletions tasks.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
:Shell Exam : 3 @ ./Shell/Exams

## Pipes
./Shell/Exams/Pipes:1-15
./Shell/Exams/Pipes:1-16

## Scripts
./Shell/Exams/Scripts:16-61
./Shell/Exams/Scripts:17-62

## Semaphores
./Shell/Exams/Semaphores:98-125
Expand Down