【发布时间】:2014-01-30 05:54:39
【问题描述】:
在 Shell 编程中给定以下数组
foo=(spi spid spider 蜘蛛侠 bar lospia)
我想使用 GREP 来搜索数组中包含三个字母 spi 的所有单词
正确的输出:spi spi spider spiderman lospia
我尝试过类似的方法
foo=(spi spid spider spiderman)
grep "spi" foo
但似乎是错误的,正确的方法是什么???
【问题讨论】:
标签: arrays bash shell debugging command-line