aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-02-02 15:31:20 -0500
committerB. Watson <urchlay@slackware.uk>2025-02-02 15:31:20 -0500
commit4608f3975eade7b9b516b8b6658cd08bf0b2c5cc (patch)
tree514c1a37523c8de425b8d29cce997acf050b830c
parent45ed00aef983ccdb77d2611e576cb177866f03d1 (diff)
downloadmisc-scripts-4608f3975eade7b9b516b8b6658cd08bf0b2c5cc.tar.gz
bsgrep: make -r use . if no files on command line.
-rwxr-xr-xbsgrep4
1 files changed, 3 insertions, 1 deletions
diff --git a/bsgrep b/bsgrep
index ad89e29..0f33e16 100755
--- a/bsgrep
+++ b/bsgrep
@@ -92,6 +92,7 @@ if($self =~ /join/) {
}
if($opt{r}) {
+ @ARGV = (".") unless @ARGV;
for(@ARGV) {
if(-d $_) {
find({
@@ -248,7 +249,8 @@ that contain matches (same as B<grep>).
=item -r
Recursively read all files under each directory, following symlinks
-only if they're on the command line (same as B<grep>).
+only if they're on the command line. If no files or directories are
+given, reads the current directory. Same as B<grep>.
=item -v