tools: fix or assume some bashism
[nit.git] / src / nc
diff --git a/src/nc b/src/nc
index 9672e88..8a382c0 100755 (executable)
--- a/src/nc
+++ b/src/nc
 
 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=$!