Hands-on task
MAC address validation
Write /usr/local/bin/ismac: if the argument is a valid MAC address (XX:XX:XX:XX:XX:XX, hex) — exit 0, otherwise 1. The script is easiest to write in the Editor tab above the terminal: /usr/local/bin is open there next to /root.
- bash
- regular expressions
- =~ operator
- grouping
- exit codes