#!/bin/bash
s=cat /usr/share/dict/words
for i in $s
do
if [ $1 = $i ];then
echo “$1 存在”
exit
fi
done
echo "$1 不存在
在Linux系统下有一个目录/usr/share/dict/ 这个目录里包含了一个词典的文本文文件,我们可以利用这个文件来辨别单词是否为词典中的单词
最新推荐文章于 2024-03-30 18:52:11 发布
#!/bin/bash
s=cat /usr/share/dict/words
for i in $s
do
if [ $1 = $i ];then
echo “$1 存在”
exit
fi
done
echo "$1 不存在