只需一步,快速开始
coolloves 发表于 2023-4-1 10:14 a=(14 25 39 46 46 52) target=46
举报
gundam06ms 发表于 2023-4-1 06:07 chatgpt给的答案没问题的,你再仔细看看,一时间也只能想到遍历一遍。
maxkvm 发表于 2023-4-1 12:30 不必先转换成字典,直接遍历即可 #!/bin/bash
maxkvm 发表于 2023-4-1 13:56 谢谢给出参考脚本,不过,你的脚本中的break命令直接中断了再次判断指定元素的下一次循环,因此只能判断 ...
gundam06ms 发表于 2023-4-1 18:22 看不太懂你写的,不过你的需求可以这样改。高版本的bash和其他shell(zsh、fish)有更复杂的功能。如果你 ...
本版积分规则 发表回复 回帖后跳转到最后一页
Archiver|手机版|小黑屋|全球主机交流论坛
GMT+8, 2025-5-11 15:33 , Processed in 0.058451 second(s), 6 queries , Gzip On, MemCache On.
Powered by Discuz! X3.4
© 2001-2023 Discuz! Team.