题解 | #打印字母数小于8的单词#
打印字母数小于8的单词
https://www.nowcoder.com/practice/bd5b5d4b93a04226a81afbabf0be797d
#!/bin/bash #空格分割,数组存单词,统计单词长度判断后输出单词 IFS=" " words=($(cat nowcoder.txt)) for word in ${words[@]} do [ ${#word} -lt 8 ] && echo $word done < nowcoder.txt exit 0