X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/29114cb84aa1a6446ab62f79f7c5dbae78516a07..4e23ddd4d595d50de4b7fa0ab6bf3533bcf42723:/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