linuxkurs/beispiele/4/recursive-grep-in-file.sh

8 lines
87 B
Bash
Raw Normal View History

2019-01-07 09:55:04 +01:00
#!/bin/bash
if [ -n $2 ]
grep -r --include="*.$2" "$1" .
else
grep -r "$1" .
fi