Kindly help me to run following program in moodle.
# first i made file in shell prompt
cat > fun
def add()
^d
then i write shell script
fun_check.sh
cat fun | grep "def" fun > file1
#grep "def" fun > file1
cat file1
cat file1 | head -n1 | cut -d " " -f1 >file2
cat file2
# content=$(cat file2)
#--- remove multiple spaces ---
cat file2 | sed 's/ */ /g' > dummy
content=$(cat dummy)
echo "content" $content
s="def"
if [ "$s" == "$content" ]
then
echo "with function"
else
echo "without function"
fi
This program perfectly run in shell prompt
but when i try to execute this program in moodle it is not working.
Actually i want that my shell script program check function available in python program or not.
and i want that student get grade automatic if student write program by function.
When i write above program in evaluate.sh file then it shows command not found error cat, grep so on.
kindly help me to execute above program in moodle.