#!/bin/bash
#文件名:checkword.sh
word=$1
grep "^$1$" /usr/share/dict/linux.words -q
if [ $? -eq 0 ];
then
echo $word is a dictionary word;
else
echo $word is not a dictionary word;
fi
shell 检查一个单词是否在字典中,布布扣,bubuko.com
原文:http://www.cnblogs.com/csxf/p/3878385.html