]> diplodocus.org Git - nmh/blobdiff - uip/mhmail
Moved the set -x after the uname and string test in autogen.sh
[nmh] / uip / mhmail
index 839b82a70d627baaffbbafe725774a9c946bb41d..a00d7cc983f8f61428c379c644a98045d6484069 100755 (executable)
@@ -50,6 +50,11 @@ finddir() {
 
 bindir=`finddir $0`
 nmhbindir=`cd "$bindir" && pwd`
+if printf 'OK\n' | tail -n 1 2>&1 | grep OK >/dev/null; then
+    tail='tail -n'
+else
+    tail='tail -'
+fi
 
 
 #### Checks for missing mandatory arguments.
@@ -256,12 +261,12 @@ if [ "$body"x = x ]; then
   fi
 
   #### Add trailing newline to body if it doesn't have one.
-  if [ `tail -n 1 "$message_file" | wc -l` -ne 1 ]; then
+  if [ `${tail}1 "$message_file" | wc -l` -ne 1 ]; then
     printf '\n' >>"$message_file" || exit 2
   fi
 else
   #### Add trailing newline to body if it doesn't have one.
-  [ `printf %s "$body" | tail -n 1 | wc -l` -ne 1 ]  &&  body="$body
+  [ `printf %s "$body" | ${tail}1 | wc -l` -ne 1 ]  &&  body="$body
 "
 
   if [ "$tmpfileresent" ]; then