my problem is that i have to count the numbers of files whit a common part of the name (Stefano) in a folder (Name) and for every name i want to echo the name with the number of count's. So names of the files in the folder will be like:
Stefano.A1
Stefano.B2
Stefano.H3
The problem i have is how to echo the files.Because it's giving me the error:
ls Stefano* | wc -l: syntax error in expression (error token is "Stefano* | wc -l")
here's the script
i=1
while [ $i -le $(ls Stefano* | wc -l) ]; do
echo "Stefano*${i}"
(i++)
done