From ba44068fe0da92bc1d9dbaede2412e4a7cec755d Mon Sep 17 00:00:00 2001 From: gobo72 Date: Sat, 10 Sep 2011 20:42:07 +0000 Subject: [PATCH] Ajout de ma propre commande pour grep avec un pipe vers less en couleur. --- stage2/hv-utilities/cgrep | 16 ++++++++++++++++ stage2/install-hv-utilities | 9 +++++---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100755 stage2/hv-utilities/cgrep diff --git a/stage2/hv-utilities/cgrep b/stage2/hv-utilities/cgrep new file mode 100755 index 0000000..84be2f1 --- /dev/null +++ b/stage2/hv-utilities/cgrep @@ -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 diff --git a/stage2/install-hv-utilities b/stage2/install-hv-utilities index 1a4d46f..78608ac 100755 --- a/stage2/install-hv-utilities +++ b/stage2/install-hv-utilities @@ -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} -- 2.20.1