Hello again
I cant understand why this is working fine
and this not for: sh script.sh *.txt
I cant understand why this is working fine
Code:
#!/bin/bash
#line counter
declare -i total=0
for file in $(find $PWD/*.txt -print)
do
total=$(($total + $(awk 'END { print NR}' $file )))
done
echo $total
and this not for: sh script.sh *.txt
Code:
#!/bin/bash
#line counter
declare -i total=0
for file in $(find $PWD/"$1" -print)
do
total=$(($total + $(awk 'END { print NR}' $file )))
done
echo $total