X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_bin%2Fhgrep.sh;fp=usr_bin%2Fhgrep.sh;h=0000000000000000000000000000000000000000;hb=c08b156abb0b2b1b1335cb1ada0c08758553238b;hp=fefe057d899a6a2216e5cd939cdcdf1bc1f1a4f4;hpb=b0c3e5ff760f99d6ff7721852bc1a0d73c5ea201;p=grml-scripts.git diff --git a/usr_bin/hgrep.sh b/usr_bin/hgrep.sh deleted file mode 100755 index fefe057..0000000 --- a/usr_bin/hgrep.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/zsh -# Filename: hgrep.sh -# Purpose: highlight grep -# Authors: Oliver Kiddle () -# Bug-Reports: see http://grml.org/bugs/ -# License: This file is licensed under the GPL v2. -################################################################################ - -if (( ! $# )); then - echo "Usage: $0:t [-e pattern...] [file...]" >&2 - return 1 -fi - -local -a regex -local htext=`echotc so` ntext=`echotc se` - -while [[ "$1" = -e ]]; do - regex=( $regex "$2" ) - shift 2 -done - -if (( ! $#regex )); then - regex=( "$1" ) - shift -fi - -regex=( "-e -s/${^regex[@]}/$htext&$ntext/g" ) -sed ${(Ff)regex[@]} "$@" - -## END OF FILE #################################################################