Browse Source

do basic printing from bash not awk

Richard Jones 10 years ago
parent
commit
961ac790a6
1 changed files with 4 additions and 7 deletions
  1. 4 7
      generate_errcodes_src.sh

+ 4 - 7
generate_errcodes_src.sh

@@ -3,14 +3,11 @@
 # Used to generate epgsql_errcodes.erl
 #
 ERRFILE="https://raw.github.com/postgres/postgres/master/src/backend/utils/errcodes.txt"
-date=$(date)
-echo "%% DO NOT EDIT - AUTOGENERATED ON $date"
+echo "%% DO NOT EDIT - AUTOGENERATED ON $(date)"
+echo "-module(epgsql_errcodes)."
+echo "-export([to_name/1])."
+echo
 wget -qO- "$ERRFILE" | awk '
-BEGIN {
-    print "-module(epgsql_errcodes)."
-    print "-export([to_name/1])."
-    print
-}
 NF == 4 && \
 $1 ~ /[^\s]{5}/ && \
 $2 ~ /[EWS]/ \