On Thu, May 14, 2009 at 8:14 AM, Andrés Ambrois <andresambr...@gmail.com> wrote: > if [ -z `grep "%!PS-Adobe-3.0" < "$fn2"` ]; then
Even better, you can use the exit code of grep, thus if grep -q 'pattern' $file; then elegant, clearer and faster :-) Some grep implementations don't support -q, so a more portable way (but uglier) of saying the same is: if grep 'pattern' $file >/dev/null ; then (Actually, some take -s for 'silent', but that's patchy as well. Only /dev/null works everywhere...) cheers, m -- martin.langh...@gmail.com mar...@laptop.org -- School Server Architect - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff _______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel