#!/bin/bash # How many commands: A simple script to count how many executable # commands are in your current PATH. setglobal IFS = '":'" setglobal count = '0' ; setglobal nonex = '0' for directory in [$PATH] { if test -d $directory { for command in ["$directory"/*] { if test -x $command { setglobal count = "$shExpr(' $count + 1 ')" } else { setglobal nonex = "$shExpr(' $nonex + 1 ')" } } } } echo "$count commands, and $nonex entries that weren't executable" exit 0