Svante Signell, le Wed 21 May 2014 09:47:08 +0200, a écrit : > > > +# Special treatment of EWOULDBLOCK for GNU/Hurd > > > +# /usr/include/bits/errno.h: #define EWOULDBLOCK EAGAIN > > > +if egrep 'define EWOULDBLOCK EAGAIN' gen-sysinfo.go > /dev/null 2>&1; > > > then > > > + egrep '^const EWOULDBLOCK = Errno(_EWOULDBLOCK)' ${OUT} | \ > > > + sed -i.bak -e 's/_EWOULDBLOCK/_EAGAIN/' ${OUT} > > > > I don't understand why you both pass the output of egrep to sed, and you > > give the -i option to sed. AIUI, the > > egrep '^const EWOULDBLOCK = Errno(_EWOULDBLOCK)' > > part is completely unused, so you can just drop it. > > Well, the -i option is to get a backup copy for debugging purposes, can > safely be removed.
Err, no, -i completely changes the behavior of sed, which then doesn't read its stdin at all any more, it will modify ${OUT} in-place instead. It happens that it is what you want here. But then just drop the egrep just before, it really is useless now. And drop the .bak suffix, I don't think the gnugo maintainers will want to see a .bak file lying behind. > Good luck making the patch better. It worked for me, but as I wrote > before I'm no sed/grep expert. I'm not the one to be convinced, gnugo maintainers are the one to be. I'm just telling you in advance what *they* will tell you. Samuel