Cathey, Jim schrieb:
>> 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
>
just to provide an alternative way:
case "$pagefile" in
*.bz2)
CAT="bzcat" ;;
*.gz)
CAT="zcat" ;;
*)
CAT="cat" ;;
esac
"$CAT" "$pagefile" | "$PAGER" "$pagefile"
this can easily be expanded to dot-whatever-you-like
re,
wh
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox