utils/bash/sources/21_win-greps

13 lines
308 B
Plaintext
Raw Normal View History

2022-08-11 15:24:41 +00:00
#!/bin/bash
function grepo {
grep --color=always "$1" . -r | awk '{ count++; print " ["count"] "$0 } '
echo -n "Select number to open: "
read num
IFS="
"
CHOICES=( `grep -n "$1" . -r | awk 'BEGIN{ FS=":" }{ print "notepad /g "$2" "$1 }'` )
bash -c ${CHOICES[$(( num - 1 ))]}
}