X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/aab07cc217bce3290de3207f21710b84c177fd5f..b84d3f849be5d858d8348a741f6b8ccd881509fe:/docs/contrib/build_nmh diff --git a/docs/contrib/build_nmh b/docs/contrib/build_nmh index cb2265cb..b00ad90f 100755 --- a/docs/contrib/build_nmh +++ b/docs/contrib/build_nmh @@ -119,6 +119,11 @@ finddir() { esac } +#### Figure out whether or not to use -n with tail. +case `printf 'OK\n' | tail -n 1 2>&1` in + OK) tail='tail -n ' ;; + *) tail='tail -' ;; +esac if install-mh -check >/dev/null 2>&1; then # Determine config options from installed nmh. @@ -290,7 +295,7 @@ if [ $status -eq 0 ]; then echo "$tests_summary" >>"$logfile" echo '===================' >>"$logfile" [ "$check" = distcheck ] && \ - echo "$checkoutput" | tail -n 4 >>"$logfile" + echo "$checkoutput" | ${tail}4 >>"$logfile" fi if [ $status -eq 0 ]; then