diff options
author | John Ankarström <john@ankarstrom.se> | 2021-07-26 13:00:36 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-07-26 13:00:36 +0200 |
commit | 7211fe0f3a1d5724bef5e1462995fae6f2a3a343 (patch) | |
tree | eaf6b0f9ba961911150ade13bef4c8095c928581 /etc | |
parent | 6dca5c66b35e27d7996cc13d8f790b74b304c805 (diff) | |
download | xutil-7211fe0f3a1d5724bef5e1462995fae6f2a3a343.tar.gz |
Remove 'g' utility
It is better replaced with simple variable declarations:
a='* */*'
c='*.[ch] */*.[ch]'
p='*.p[lm] */*.p[lm]'
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/g | 30 |
1 files changed, 0 insertions, 30 deletions
@@ -1,30 +0,0 @@ -#!/bin/sh - -# g -- poor man's ack - -IFS=' -' - -pat= -opt= -i=0 - -while [ $((i++)) -lt $# ]; do - case "$1" in - -*) opt=`printf '%s%s\n' "$opt" $1` - shift ;; - *) break ;; - esac -done - -[ $# -eq 0 ] && { echo usage: $0 [-...] pattern [file ...] 1>&2; exit 1; } - -pat=$1 -shift - -files=`find . -name '*.c' -or -name '*.h' -or -name '*.cc' | sed s,./,,` -[ -z "$files" ] && [ -z "$*" ] && { echo no matching files found 1>&2; exit 1; } - -# todo (?): treat argument \*.x like -or -name \*.x - -p grep $opt -n "$pat" $files "$@" |