I have to count all executable files- done it and count files which are .sh files- no idea how to do it. Any help? Here's my code:
c=0 d=0 for f in /home/lenovo/*; do if [ -x "$f" ] ; then c=$(($c+1)) if $f . name -iname = '*.sh'; then d=$(($d+1)) fi fi done echo $c echo $d