Skip to content

Instantly share code, notes, and snippets.

View astout's full-sized avatar

Alex Stout astout

View GitHub Profile
@astout
astout / count_lines.sh
Last active December 8, 2020 15:49
List number of lines in a file or in all files in a directory (non-recursive). Data is outputted in neat columns.
# author: Alex Stout
# check if the provided argument is a directory
if [[ -d $1 ]]; then
: # nop -- do nothing
elif [[ -f $1 ]]; then # or is it a file
: # nop -- do nothing
else
echo "argument is invalid"
exit 1