Чи є спосіб отримати ціле число, яке wc повертає в bash?
В основному я хочу записати номери рядків і кількість слів на екрані після імені файлу.
output: filename linecount wordcount
Ось що я маю досі:
files=`ls`
for f in $files;
do
if [ ! -d $f ] #only print out information about files !directories
then
# some way of getting the wc integers into shell variables and then printing them
echo "$f $lines $ words"
fi
done