标签:log 括号 read http shel 结果 bin element 注意
题目一:求和练习:echo "$@"
)echo ${wang[*]}
sumarray $kai
echo "$@"
)echo "$@"
)<br/>result=
array $kai<br/>echo "结果是:${result[*]}"<br/>![](http://i2.51cto.com/images/blog/201801/30/127f2176aaf433ae52d6201db2a8fae2.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)<br/>解析: 这道题目考察点是围绕着数组的处理来的,不仅将数组拆分成单个变量,也要做到将数组合并为整体输出。<br/>第三题:求阶乘<br/>#!/bin/bash<br/>function jj {<br/>if [ $1 -eq 1 ];then<br/>echo 1<br/>else<br/>local temp=$[$1-1]<br/>local result=
jj $temp<br/>echo $[$result * $1]<br/>fi<br/>}<br/>read -p "请输入数字:" number<br/>result1=
jj $number`标签:log 括号 read http shel 结果 bin element 注意
原文地址:http://blog.51cto.com/13560258/2068574