#!/bin/bash echo `ls /usr/share/dict` s=`cat /usr/share/dict/linux.words` for i in $s; do if [ $1 = $i ];then echo "$1 在字典中" exit fi done echo "$1 不在字典中"
判断字典中是否有这个单词
原文:https://www.cnblogs.com/hcy-24/p/11601973.html