Skip to content

Instantly share code, notes, and snippets.

@tankywoo
Created December 14, 2012 04:53
Show Gist options
  • Save tankywoo/4282767 to your computer and use it in GitHub Desktop.
Save tankywoo/4282767 to your computer and use it in GitHub Desktop.
判断一个文件是否保存某个字符/字符串
grep "str" file
if [[ $? -eq 0 ]];then
echo "error"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment