作者:手机用户2502897397 | 来源:互联网 | 2023-05-18 20:49
ImworkinginZSH,butImsureBASHinstructionswillprobablyhelpalso.Ineedtohaveaforloop
Im working in ZSH, but Im sure BASH instructions will probably help also. I need to have a for loop that goes thru the values stored in the array lw and then launches a shell script, based on the name stored in the array.
我在ZSH工作,但我确信BASH指令也可能有所帮助。我需要一个for循环,通过存储在数组lw中的值,然后根据存储在数组中的名称启动一个shell脚本。
So far, this is what I've come up with:
到目前为止,这是我提出的:
$lw=('plugin1' 'plugin2' 'plugin3')
for i in $lw;
do . ~/Library/Rogall/plugins/$lw[$i]/lw.prg end;
done
it just gives me an error when run saying that it can't find ~/Library/Rogall/plugins//lw.prg, so it appears its just ignoring my variable all togethor.
它只是给我一个错误,当运行说它找不到〜/ Library / Rogall / plugins // lw.prg,所以它似乎只是忽略了我的变量all togethor。
Any ideas where I've messed up?
我搞砸了的任何想法?
2 个解决方案