summaryrefslogtreecommitdiffstats
path: root/hl_bin/diff
diff options
context:
space:
mode:
authormbornet-hl <mbornet.pro@wanadoo.fr>2015-10-22 16:30:26 +0200
committermbornet-hl <mbornet.pro@wanadoo.fr>2015-10-22 16:30:26 +0200
commit3808d1493357a452e154e0f761b647abbefb742d (patch)
tree76b2970cd945b120a3fff325a42000c60da13c51 /hl_bin/diff
parent1c9d39b5537a3a263852f7c6ab5dc9005aedc090 (diff)
downloadhl-3808d1493357a452e154e0f761b647abbefb742d.zip
hl-3808d1493357a452e154e0f761b647abbefb742d.tar.gz
hl-3808d1493357a452e154e0f761b647abbefb742d.tar.bz2
Modified hl_generic : wait / stdout / stderr
Diffstat (limited to 'hl_bin/diff')
-rwxr-xr-xhl_bin/diff23
1 files changed, 18 insertions, 5 deletions
diff --git a/hl_bin/diff b/hl_bin/diff
index 4d89c27..0125919 100755
--- a/hl_bin/diff
+++ b/hl_bin/diff
@@ -3,10 +3,10 @@
# Script for command output colorization
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
-# @(#) [MB] cr_hl_generic Version 1.7 du 15/09/26 -
+# @(#) [MB] cr_hl_generic Version 1.10 du 15/10/10 -
#
-# This script call the original programme with all the arguments
-# it received, and pipe it to "hl" using its name as the "hl"
+# This script calls the original programme with all the arguments
+# it received, and pipes it to "hl" using its name as the "hl"
# configuration.
#
# In case the user doesn't want the output of the command to
@@ -14,6 +14,12 @@
# USE_HL=no cmd [args ...]
#
+OUT=/tmp/OUT.$$
+ERR=/tmp/ERR.$$
+
+mknod $OUT p
+mknod $ERR p
+
case "$USE_HL" in
n|N|no|NO|0) USE_HL="no"
;;
@@ -34,8 +40,15 @@ if [ "$USE_HL" = "no" ]; then
else
# Default behaviour : colorization
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- "$progname" "$@" | hl --"$progname"
- rc=${PIPESTATUS[0]}
+ hl -u --"$progname" < "$ERR" & hl --"$progname" < "$OUT" & \
+ "$progname" "$@" > "$OUT" 2> "$ERR"
+
+ rc=$?
+
fi
+wait
+
+rm -f "$OUT" "$ERR"
+
exit $rc