#! /bin/bash
#------------------------------------------------------------------------------
#$Author: saulius $
#$Date: 2017-11-23 21:33:10 +0000 (Thu, 23 Nov 2017) $
#$Revision: 3924 $
#$URL: file:///home/saulius/svn-repositories/paskaitos/VU/software/assignment-evaluation/trunk/scripts/do-check-BPKM-1st--shell-commands $
#------------------------------------------------------------------------------
#*
# Check if the requied shell commands were called.
#**

set -ue
## set -x

DIRECTORY="$1"

ID='$Id: do-check-BPKM-1st--shell-commands 3924 2017-11-23 21:33:10Z saulius $'

cd "${DIRECTORY}"

for CMD in \
    'curl' \
    'sort' \
    'uniq' \
    'set -x' \
    'history' \
    'mkdir' \
    'cd' \
    'ls' \
    #
do

if [ $(find -type f \! -perm /111 -exec grep -wP "$CMD" {} \; | wc -l) -eq 0 ]
then

cat <<EOF
-- [AUTO;INTERFACE;$(echo $ID | sed 's/\$//g')]
   Nepanaudojote komandos '$CMD' (-5 balai)

EOF

fi

done
