From d03a40b23e420834fe95b07c62a57e328be90b06 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Wed, 4 Jan 2012 20:24:00 -0500 Subject: [PATCH] tools: fix or assume some bashism Remove some bashsims in git-gen-version.sh and nc. Change the #! in showerr.sh to bash. Signed-off-by: Jean Privat --- src/git-gen-version.sh | 6 ++++-- src/nc | 10 +++++----- src/showerr.sh | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/git-gen-version.sh b/src/git-gen-version.sh index b21d8bb..e018dc6 100755 --- a/src/git-gen-version.sh +++ b/src/git-gen-version.sh @@ -20,7 +20,9 @@ # The version number is stored in a dedicated Nit module. gen_version() { - if ! grep "$*" nit_version.nit >/dev/null 2>&1; then + if grep "$*" nit_version.nit >/dev/null 2>&1; then + : + else cat > nit_version.nit</dev/null) +VN=`git describe --always HEAD 2>/dev/null` if [ "$?" != "0" ]; then if [ -r ../VERSION ]; then VN="$(cat ../VERSION)" diff --git a/src/nc b/src/nc index 9672e88..8a382c0 100755 --- a/src/nc +++ b/src/nc @@ -17,11 +17,11 @@ NITC="../c_src/nitc" NITCOPTS="-v -W" -CSRC=$( (cd ../c_src; pwd) ) +CSRC=$` (cd ../c_src; pwd) ` trap_action() { - test -n $sub_command && kill $sub_command - test -e $pipe && rm -f $pipe + test -n "$sub_command" && kill $sub_command + test -e "$pipe" && rm -f $pipe exit 1 } @@ -39,8 +39,8 @@ esac trap trap_action INT TERM echo ${NITC} ${NITCOPTS} ${opts} "$@" -pipe=$(mktemp nc.stderr.XXXXX) -rm "$pipe" +pipe=$`mktemp nc.stderr.XXXXX` +rm "$pipe" 2>/dev/null mkfifo "$pipe" ./showerr.sh <"$pipe" & sub_command=$! diff --git a/src/showerr.sh b/src/showerr.sh index 831acca..db057e5 100755 --- a/src/showerr.sh +++ b/src/showerr.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # This file is part of NIT ( http://www.nitlanguage.org ). # # Copyright 2008 Jean Privat -- 1.7.9.5