Ralf Wildenhues <[EMAIL PROTECTED]> writes:

> -     @grep -nE '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] &&         \
> +     @grep -nE '\<free \(\('                                         \
> +         $(srcdir)/{lib,src}/*.[chly] /dev/null 2>/dev/null &&       \

How about if we use 'shopt -s nullglob' instead?  That way, we don't
have to have the '2>/dev/null', and we catch a problem if a file is
unreadable (e.g., dangling symlink).  shopt isn't portable, but surely
we can assume Bash here.

We can do this systematically, even for files that don't glob now.
For example, instead of:

        @sed -n '/^# *include /s///p' $(srcdir)/src/system.h            \
                /dev/null 2>/dev/null                                   \
        ...

we can have this:

        @shopt -s nullglob;                                             \
        sed -n '/^# *include /s///p' $(srcdir)/src/system.[h] /dev/null \
        ...

>  sc_changelog:
> -     @grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) &&    \
> +     @sed '/^-----/,$$d' $$(find . -maxdepth 2 -name ChangeLog)      \

Shouldn't there be a /dev/null here too, in case there are no ChangeLog
files at all?

> -     @sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
> -       | grep -Ev 'sys/(param|file)\.h' \
> +     @sed -n '/^# *include /s///p' $(srcdir)/src/system.h            \
> +             /dev/null 2>/dev/null                                   \

If you don't like my shopt -s nullglob suggestion above, then the
/dev/null is not needed here (and in similar places).


Reply via email to