shell通过for循环连续赋值
account="abcdfghyj"for((i=1;i<=3;i++));doaccount$i=`echo$account|cut-d''-f$i`;done出现了...
account="abc dfg hyj"
for (( i=1 ; i <= 3 ; i++ ));do account$i=`echo $account |cut -d ' ' -f$i` ; done
出现了如下错误
-bash: account1=abc: command not found
-bash: account2=dfg: command not found
-bash: account3=hyj: command not found 展开
for (( i=1 ; i <= 3 ; i++ ));do account$i=`echo $account |cut -d ' ' -f$i` ; done
出现了如下错误
-bash: account1=abc: command not found
-bash: account2=dfg: command not found
-bash: account3=hyj: command not found 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询