commit 98599365d688bffc3a18911b7256f35ed0cde7aa parent b472a13ce66eea4c9559ab5ff3484069f8dffb1b Author: gearsix <gearsix@tuta.io> Date: Tue, 31 Jan 2023 11:00:09 +0000 renamed grepf -> grepr; minor shellcheck fix Diffstat:
D | src/posix/grepf.sh | | | 15 | --------------- |
A | src/posix/grepr.sh | | | 15 | +++++++++++++++ |
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/posix/grepf.sh b/src/posix/grepf.sh @@ -1,15 +0,0 @@ -#!/bin/sh -# grepf (grep find) -# description: find files containing string $2 in directory/file $1 -# dependencies: grep -# e.g.$ grepf dogs/ "shades" - -if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then - echo "Usage: grepf DIRECTORY EXPRESSION" - echo "" - echo "call grep EXPRESSION on all files in DIRECTORY" - exit -fi - -grep -rnw $1 -e "$2" - diff --git a/src/posix/grepr.sh b/src/posix/grepr.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env sh +# grepr (grep recursively) +# description: find files containing string $2 in directory/file $1 +# dependencies: grep +# e.g.$ grepr dogs/ "shades" + +if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + echo "Usage: grepr DIRECTORY EXPRESSION" + echo "" + echo "call grep EXPRESSION on all files in DIRECTORY" + exit +fi + +grep -rnw "$1" -e "$2" +