shell script implementation of man

Cathey, Jim jcathey at ciena.com
Fri Nov 21 19:06:38 UTC 2008


>case "$pagefile" in
>*.bz2)
>        bzcat "$pagefile" | "$PAGER" ;;
>*.gz)
>        zcat "$pagefile" | "$PAGER" ;;
>*)
>        "$PAGER" "$pagefile" ;;
>esac
>
>paths=
>pagefile=
>pagearg=
>section=


If there is no further work (and I don't see any), is it
not appropriate to "exec" the last step, thus eliminating
one extra process (the shell)?  Viz:

case "$pagefile" in
*.bz2)
        exec bzcat "$pagefile" | "$PAGER" ;;
*.gz)
        exec zcat "$pagefile" | "$PAGER" ;;
*)
        exec "$PAGER" "$pagefile" ;;
esac

-- Jim







More information about the busybox mailing list