To execute this script in bash shell must and should provide the execute permision. To give execute permission in user level use the command:
If you are using sh shell no need of providing permission
chomd u+x file_name.sh
echo "enter the number" read n fact=1 while [ $n -gt 0 ] do fact=`expr $fact \* $n` n=`expr $n - 1` done echo "factorial=$fact"
No comments:
Post a Comment