diff --git a/.github/scripts/check.sh b/.github/scripts/check.sh index fd842221..f52a56f9 100755 --- a/.github/scripts/check.sh +++ b/.github/scripts/check.sh @@ -17,7 +17,7 @@ pattern ${FILE} "'ps aux > $P' used" "ps(\s+)[-]?aux(\s*)>{1,2}(\s*)(.*/)*$P" pattern ${FILE} "'$P' copied to '$C''" "cp(\s+).*$P(\s+)(.*/)*$C" pattern ${FILE} "'backup' directory created'" "mkdir\s+(.*\/)?(backup)" pattern ${FILE} "'$C' moved into 'backup' directory" "(mv)(\s+)(.*\/)?($C)\s+(.*\/)?(backup)\/?" -pattern ${FILE} "Lines counted and saved to '$S'" "wc\s+-l\s+((.*\/)?($P))\s*(\|\s*cut\s*-c.*\s+)?\s*>\s*((.*\/)?($S))" +pattern ${FILE} "Lines counted and saved to '$S'" "wc\s+-l\s+((+\s*((.*\/)?($S))" pattern ${FILE} "Grepped with line numbers for '/bin' in '$P' and appended to $S" "grep(\s+)((-.*n.*)[\"']?\/bin[\"']?(\s+)|[\"']?\/bin[\"']?(\s+)(-.*n.*))(.*/)*$P(\s+)>>(\s+)(.*/)*$S" pattern ${FILE} "'history' with 'tail' used and saved to $M" "history\s*\|\s*tail\s+((-[0-9]+)|(-n((\s*\+\s*)|(\s*))[0-9]+))\s*>\s*((.*\/)?($M))" pattern ${FILE} "'cat $S $M' used" "cat(\s+)(.*/)*$S(\s+)(.*/)*$M" diff --git a/.github/scripts/test_data/10.txt b/.github/scripts/test_data/10.txt new file mode 100644 index 00000000..f9e48fff --- /dev/null +++ b/.github/scripts/test_data/10.txt @@ -0,0 +1,36 @@ +jakub@VBox:~/testkat$ cat selected.txt commands.txt + 184 2132 17894 +root 623 0.0 0.7 52228 21344 ? Ss 11:58 0:00 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers +root 750 0.0 0.7 129340 22416 ? Ssl 11:58 0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal +jakub 1392 0.0 0.1 50752 4848 ? S processes.txt + 610 cp processes.txt copy.txt + 611 mkdir backup + 612 mv copy.txt backup + 613 wc processes.txt + 614 wc < processes.txt > selected.txt + 615 grep "/bin" processes.txt + 616 grep "/bin" processes.txt > selected.txt + 617 history + 618 history | tail -n13 > commands.txt diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index 6dc33c13..778a5b8e 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -19,3 +19,4 @@ test test_data/6.txt test test_data/7.txt test test_data/8.txt test test_data/9.txt +test test_data/10.txt