#!/bin/sh
echo" 请输入圆半径:"
echo$var
var=3.14*var*var
echo" 圆面积为:$var"
将该 shell脚本保存为test1 。
在命令行执行 :chmod+x test1
在命令行执行 :./test1,得到输出结果。
改正后
#!/bin/sh
echo "Please input The Radius:"
read var #read var from keyboard
echo $var #display the value of var
var=`expr 314 /* $var /* $var` #compute the result: Area
echo "The Area is: $var" #display the result Area
在终端运行提示:bash:chmod+x command not found
./gengxin 权限不够
这是为什么?
<script type="text/javascript"> </script>