Hands-on task
This task is step 7 of the course “Bash scripts: from a loop to a robust script”
Count Non-Empty Lines
Write /root/countlines.sh that reads /root/data.txt and prints the number of non-empty lines. Run it, with the result going to /root/lines.txt.
What you'll practise:
- grep
- grep -c
- regular expressions
- bash scripts
- line counting