On Mon, Apr 4, 2011 at 9:25 AM,  <[email protected]> wrote:
> http://forums.freebsd.org/showthread.php?p=129996

    gordon@'s observation seems valid:
http://forums.freebsd.org/showpost.php?p=130007&postcount=2 ?
    Your other question about grep returning 141 was because it caught
SIGPIPE, so probably a *csh bug (I wouldn't be surprised).
    When in doubt, simplify (and don't use csh)!

$ csh -c "cat /sys/conf/NOTES | grep -m 1 '^device' /sys/conf/NOTES; echo \$?"
device          hwpmc                   # Driver (also a loadable module)
141
$ env ENV=/dev/null sh -c "cat /sys/conf/NOTES | grep -m 1 '^device'
/sys/conf/NOTES; echo \$?"
device          hwpmc                   # Driver (also a loadable module)
0

    You might want to ktrace/truss the piped process to figure out why
it's catching SIGPIPE, and maybe submit a bug report once you figure
out why csh isn't playing nicely.
    Happy hunting.
Thanks,
-Garrett
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to