← All labs

EX200 · 03/10 · 35 min · Free

Create simple shell scripts

Official EX200 group: conditionals, loops, script arguments, command output.

Work on your practice VM. After install, run prep-exam.sh once, snapshot 01_Exam_Start, then SSH as student.

When you finish this lab, copy the grade script onto the VM: sudo bash grade-obj-scripts.sh

Tasks

  1. /usr/local/bin/logfilter.sh, root, mode 755.
  2. $1 extended regexp, $2 input file. No arguments → exit 2.
  3. Matching lines to /var/tmp/filter.out. Last line MATCHES:<n>. Exit 0 on success. Use if/[[ and a for or while loop.