chiark / gitweb /
bin: Use 'head -n 1' rather than 'head -1' (_POSIX2_VERSION=200112).
authorColin Watson <cjwatson@chiark.greenend.org.uk>
Tue, 12 Aug 2003 12:56:47 +0000 (12:56 +0000)
committerColin Watson <cjwatson@chiark.greenend.org.uk>
Tue, 12 Aug 2003 12:56:47 +0000 (12:56 +0000)
cancel-this
get-sig
validate-directory

index 1009b35e96a473aed0bc74044e3e1fcdcb339d1f..bcbefa9b92ebd92f1c035335c54562fc7d0f0164 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
 #! /bin/sh
 
-MSGID=`grep -i '^Message-ID: ' | sed 's/^Message-ID: //' | head -1`
+MSGID=`grep -i '^Message-ID: ' | sed 's/^Message-ID: //' | head -1`
 
 echo 'Locally cancelling a post with the following Message-ID:'
 echo "  $MSGID"
 
 echo 'Locally cancelling a post with the following Message-ID:'
 echo "  $MSGID"
diff --git a/get-sig b/get-sig
index 24da9bb73b3b293fd525e57cdf462993ca39136f..f1c0c41d34d0187d3be55df546c5adf1e1b5f653 100755 (executable)
--- a/get-sig
+++ b/get-sig
@@ -1,7 +1,7 @@
 #! /bin/bash
 
 if [ "X$1" == "X" ]; then
 #! /bin/bash
 
 if [ "X$1" == "X" ]; then
-  NAME=$(grep '^\*' ~/.siglist | head -1 | tr -s '\t' ' ' | cut -d' ' -f2)
+  NAME=$(grep '^\*' ~/.siglist | head -1 | tr -s '\t' ' ' | cut -d' ' -f2)
   if [ -z "$NAME" ]; then
     echo "Usage: $0 signature-group [pattern]" >&2
     exit 1
   if [ -z "$NAME" ]; then
     echo "Usage: $0 signature-group [pattern]" >&2
     exit 1
@@ -10,7 +10,7 @@ else
   NAME=$1
 fi
 
   NAME=$1
 fi
 
-ARGS=$(grep "^$NAME\\>" ~/.siglist | head -1 | tr -s '\t' ' ' | cut -d' ' -f2-)
+ARGS=$(grep "^$NAME\\>" ~/.siglist | head -1 | tr -s '\t' ' ' | cut -d' ' -f2-)
 if [ -z "$ARGS" ]; then
     echo "No such signature group: $NAME" >&2
     exit 1
 if [ -z "$ARGS" ]; then
     echo "No such signature group: $NAME" >&2
     exit 1
index 6615bef29099ae327222a436d2b22267b96aa1cb..a0164ed890774a5f91d305805467350cfb3c8883 100755 (executable)
@@ -10,7 +10,7 @@ set +e
 shopt -s nullglob
 for x in *.html; do
     echo "$BASE_URL/$x"
 shopt -s nullglob
 for x in *.html; do
     echo "$BASE_URL/$x"
-    if head -1 "$x" | egrep -q '(xml|XHTML)'; then
+    if head -1 "$x" | egrep -q '(xml|XHTML)'; then
        SP_CHARSET_FIXED=YES SP_ENCODING=XML \
            SGML_CATALOG_FILES=/usr/share/sgml/declaration/xml.soc \
            nsgmls -wxml -s "$BASE_URL/$x"
        SP_CHARSET_FIXED=YES SP_ENCODING=XML \
            SGML_CATALOG_FILES=/usr/share/sgml/declaration/xml.soc \
            nsgmls -wxml -s "$BASE_URL/$x"