Code:
for i in 'find $1 -name $4 -type f' ; do
path='readlink -f $4'
words='cat "$i" | wc -w'
echo "$path: $words palavras"
done
Prints:
/home/miglui/Desktop/SO/teste.txt: 14 palavras
/home/miglui/Desktop/SO/teste.txt: 48 palavras
/home/miglui/Desktop/SO/teste.txt: 29 palavras
Should Print:
/home/miglui/Desktop/SO/teste/1/teste.txt: 14 palavras
/home/miglui/Desktop/SO/teste/2/teste.txt: 48 palavras
/home/miglui/Desktop/SO/teste/teste.txt: 29 palavras
The code is not printing the entire path of the files. Where might the error be?