gpt4 book ai didi

linux - 为什么这 while 在第一次迭代后停止?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:18:57 25 4
gpt4 key购买 nike

<分区>

如果我执行以下操作

tr -cd 'a-z' < /dev/urandom | fold -w10 | head -n40 > pw
for f in $(seq -w 40); do echo linux$f.example.com;done > hosts

while read -r x && read -r y <&3; do ssh $x -l root echo $y;done <hosts 3<pw

然后循环在第一次迭代后停止,但如果我插入一个 echo(这不是我想要的)然后它循环遍历所有 40。

while read -r x && read -r y <&3; do echo ssh $x -l root echo $y;done <hosts 3<pw 

问题

如何在不先创建临时文件的情况下让它执行所有 40 次迭代?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com