Last active
September 28, 2018 20:16
-
-
Save abdulbadii/ef33a8a38e28c376466be406238edb68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/bash | |
g() { | |
unset c l s f | |
for a | |
{ | |
if [[ $a =~ ^- ]] ;then | |
test "${a:1:1}" = l &&l=1 | |
else | |
if test ! $s ;then s=$a | |
elif test ! $f ;then f=$a;fi | |
fi | |
let c++ | |
} | |
test $l &&s="\Q$s\E" | |
case $c in | |
1) gre --color=always -Hine "$s" --include='\.(txt|ini|c.?.?|js.?.?|dat|cmd|h|htm.?|log|reg|\w*rc|sh)$|^(configure|makefile|readme)' -r .;; | |
[23]) gre --color=always -Hiane "$s" --include="\.$f" -r .;; | |
esac | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment