#!/bin/bash aaa=(1 2 3 4) bbb=(a b c d) set -- ${aaa[@]} while (($#>0));do echo ${1} shift done set -- echo "-----------------------" set -- ${bbb[@]} while (($#>0));do echo ${1} shift done set -- ----------(结果)-------------- 1 2 3 4 ----------------------- a b c d
时间: 2024-12-13 15:56:33