小编use*_*377的帖子

我想要一个脚本,它将从用户那里获取多个列号并反转内容

我想要一个 Unix 脚本,它将从用户那里获取多个列号并反转内容。

declare -a param="$@"
# enter 0 when exit the insert element
echo "Enter the numbers"
read n
while [ $n -ne 0 ]
do
    x[$i]=`expr $n`
    read n
    let i++
done

#display the all array elements
echo "Array values ${x[@]}"
echo "Array values ${x[*]}"

# To find the array length
length=${#x[*]}
echo $length
Run Code Online (Sandbox Code Playgroud)

bash shell-script

3
推荐指数
1
解决办法
296
查看次数

标签 统计

bash ×1

shell-script ×1