$ cat mytest.sh
#!/bin/bash
#
# Description:
#
src=mytest.f90
exe=mytest.exe
f90=ifort
opt="-CB -traceback -fpe0"
prog_name=mytest
cat <<EOF>mytest.f90
program mytest
print '(A)','Hello, I am mytest.'
stop
end program mytest
EOF
echo
echo Compiling mytest.f90 ...
ifort -CB -traceback -fpe0 mytest.f90 -o mytest.exe
if [ 0 -ne 0 ]; then
echo
echo Compile error!
echo
echo Terminated.
echo
exit 1
fi
echo "Done Compile."
echo
ls -lh mytest.exe
echo
echo
echo mytest.exe is running ...
echo
mytest.exe
if [ 0 -ne 0 ]; then
echo
echo ERROR in mytest.exe: Runtime error!
echo
echo Terminated.
echo
exit 1
fi
echo
echo "Done mytest.exe"
echo
$ sh mytest.sh
Compiling mytest.f90 ...
Done Compile.
-rwxrwxr-x 1 am am 617K 5月 12 09:36 mytest.exe
mytest.exe is running ...
Hello, I am mytest.
Done mytest.exe
上記のmytest.shのような雛形を自動作成する