What is the problem in following code.
Moodle Produce following Error
"cat: file2: No such file or directory"
vpl_Evalute.sh
#! /bin/bash
cat > vpl_execution <<EOF
#! /bin/bash
cat fun.py > user_source
cat user_source | grep "def" user_source > cut_fun_line
cat cut_fun_line | head -n 1 cut_fun_line > new_file
cat new_file | cut -d " " -f1 > file2
head=$(cat file2)
br="def"
if [ "$head" = "$br" ]
then
echo "function Available"
else
echo "Without function"
fi
EOF
chmod +x vpl_execution
Fun.py
def add():
print "hello"
add()