Ajout de ma propre commande pour grep avec un pipe vers less en couleur.
authorgobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Sat, 10 Sep 2011 20:42:07 +0000 (20:42 +0000)
committergobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Sat, 10 Sep 2011 20:42:07 +0000 (20:42 +0000)
stage2/hv-utilities/cgrep [new file with mode: 0755]
stage2/install-hv-utilities

diff --git a/stage2/hv-utilities/cgrep b/stage2/hv-utilities/cgrep
new file mode 100755 (executable)
index 0000000..84be2f1
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+print_usage()
+{
+    echo "$(basename $0) -- Grep and Less front end."
+    echo "Usage: $(basename $0) GREP_STRING"
+}
+
+if [ $# -ne 1 ]; then
+    print_usage
+    exit 1
+fi
+
+GREP_STRING=${1}
+
+grep --color=always -rn "${GREP_STRING}" * | less -RFX
index 1a4d46f..78608ac 100755 (executable)
@@ -6,10 +6,11 @@ SRCDIR="./hv-utilities"
 PREFIX="/usr/local"
 BINDIR="${PREFIX}/bin"
 SYSBINDIR="${PREFIX}/sbin"
-BIN_UTILITIES="camera-download cd-erase cd-copy pstopdf distro-backup dos2unix \
-               dvd-ram-format fix-avi gztobz2 hv-backup hv-video-dvd mail-files \
-               mail-if-fail mail-statistics media-write pstopdf replace.pl \
-               rotatelogs setdate strip-debug-symbols tarbz2 tildes-clean"
+BIN_UTILITIES="camera-download cd-erase cd-copy cgrep pstopdf distro-backup \
+               dos2unix dvd-ram-format fix-avi gztobz2 hv-backup hv-video-dvd \
+               mail-files mail-if-fail mail-statistics media-write pstopdf \
+               replace.pl rotatelogs setdate strip-debug-symbols tarbz2 \
+               tildes-clean"
 
 for program in ${BIN_UTILITIES}; do
     install -v ${SRCDIR}/${program} ${BINDIR}