I am writing a bash script that needs to takes in command line arguments, and list the number of executable files in the current directory.
So for: $ ./script *.html *.txt
It should display the count of all executable files that match those command line arguments, or the lack of.
Right now I have:
echo -n "All executable files : "
ls -l $* | find . -type f -executable | wc -l
But I get ls: write error: Broken pipe
.
How would I accomplish this?