# HG changeset patch # User edhoprima # Date 1241546214 0 # Node ID cba73f6a96bbf40eeb2ede60e96cc5f390e50c4c # Parent ffca564daefa139052008ea41ace9716a47bbd3a grep check. OpenSolaris' default grep doesn't support -f diff -r ffca564daefa -r cba73f6a96bb moefetch.sh --- a/moefetch.sh Sat Apr 25 16:26:00 2009 +0000 +++ b/moefetch.sh Tue May 05 17:56:54 2009 +0000 @@ -22,7 +22,7 @@ # requirement: wget, libxslt, md5sum (or md5) # configs -# program additional paths for: cut, sed, wc, md5(sum), wget, xsltproc +# program additional paths for: cut, sed, wc, md5(sum), wget, xsltproc, grep extrapath= # md5 calculation, expected output: <32digit md5> @@ -119,11 +119,13 @@ # path initialization -export PATH=${PATH}:$extrapath +export PATH=$extrapath:${PATH} # verify all programs required do indeed exist + + # basic tools -commands="cut sed wc wget xsltproc xargs rm mkdir chown comm" +commands="cut sed wc wget xsltproc xargs rm mkdir chown comm grep" cmderr=" " for cmd in $commands do @@ -145,6 +147,20 @@ exit 1 fi +# grep checking +# originally created for workaround on solaris +#if [ `uname` = "SunOS" ]; then + FAIL=0 + echo "blah" > superrandomtestfile + echo "blah" > superrandomtestfile.2 + grep -f superrandomtestfile.2 superrandomtestfile > /dev/null 2>&1 || FAIL=1 + rm superrandomtestfile superrandomtestfile.2 superrandomtestfile.3 > /dev/null 2>&1 + if [ $FAIL = 1 ]; then + echo "Your grep is not compatible. Please install or set path of correct grep" + exit 1 + fi +#fi + # all green (part 1)! let's go (until we check the tag)