Skip to content

Commit 39734ef

Browse files
committed
First EasyKey.bash function to search text inside files
1 parent a8d8e0b commit 39734ef

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

EasyKey.bash/bashstuff.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
####################################
4+
# EasyKey.bash utility main script #
5+
####################################
6+
7+
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
8+
source "$script_dir/../shellmenu.sh"
9+
10+
findText(){
11+
echo "Text pattern:"
12+
read textPattern
13+
echo "File pattern:"
14+
read filePattern
15+
find . -name "$filePattern" -exec grep -H "$textPattern" {} + | awk -F ":" '{printf "%-40s %s\n", $1, $2}'
16+
}
17+
18+
menuInit "EasyKey.bash"
19+
submenuHead "Usefull:"
20+
menuItem f "Find text inside files" findText
21+
startMenu "$(pwd)"

0 commit comments

Comments
 (0)