>_ IzzyLab

Topic breakdown

The key word in this task is 'non-empty': wc -l would count all lines, including empty ones, so you need a filter that removes zero-length lines. A handy tool is grep in count mode (the -c flag returns not the lines but their number). What's left is to pick a pattern that matches any non-empty line: in regexes 'any single character' matches only where there is at least something.

What's checked

  1. lines.txt has the count of non-empty lines from data.txt
  2. countlines.sh counts the file's non-empty lines

What it looks like