I am trying to output the number of directories in a given path on a SINGLE line. My desire is to output this:
ls -l $ARGUMENT | egrep -c '^drwx'; echo -n "directories"
echo "$(ls -l "$ARGUMENT" | egrep -c '^drwx') directories"
This uses the shell's feature of final newline removal for command substitution.