Skip to content

Instantly share code, notes, and snippets.

View tankywoo's full-sized avatar

Tanky Woo tankywoo

View GitHub Profile
@tankywoo
tankywoo / gist:4282767
Created December 14, 2012 04:53
判断一个文件是否保存某个字符/字符串
grep "str" file
if [[ $? -eq 0 ]];then
echo "error"
fi
@tankywoo
tankywoo / gist:4274450
Created December 13, 2012 06:07
一行写出shell判断语句
#!/bin/bash
# Tanky Woo@2012-12-13
[ "$?" -ne "0" ] && { echo "FAIL"; exit 1; } || echo "SUCC"