Upload files to ''

This commit is contained in:
r4 2021-04-01 19:09:30 +00:00
parent ba984f9596
commit a84751d79c

19
linecount Normal file
View File

@ -0,0 +1,19 @@
#! /usr/bin/env sh
###
# Counts the lines of text in the specified files/directories
###
echo "Counting lines in '$(find "$@" -maxdepth 0)'"
n=0
find "$@" -exec wc -l {} \; 2>/dev/null | while true; do
if read line; then
n=$["$n" + "$(echo "$line" | cut -d" " -f1)"]
n_human_readable="$(echo "$n" | numfmt --to=si --round=nearest)"
printf "\e[2KLines: %s (counting)\r" "$n_human_readable"
else
printf "\e[2KLines: %s\r\n" "$n_human_readable"
break
fi
done