A bash version of tomnomnom's gf tool found here: gf
A wrapper around grep to avoid typing common patterns.
I do not take credit in any way for the idea of this tool. I simply just wanted to re-write it in bash
I re-wrote this awesome tool in bash for the following reasons:
- People may have issues configuring golang.
- People may not want golang installed on their system.
- People may prefer to use bash instead.
The pattern files are stored in a separate file called patterns.sh as functions.
You can edit them, change the flags, add new patterns, etc. just like you would any normal file with your favorite editor.
An auto complete bash file exists that you can load into your .bashrc file and then source it from there.
You can also attempt to have the install.sh file do this for you. You may still have to source the file after.
You can configure the install.sh file to fit your needs.
Inside the main.sh file, it is configured to source the patterns.sh file as if you installed bgf in your home directory.
Like so:
~/bgf/patterns.sh
If you plan to move bgf into a different directory, you will need to change this sourced directory.
You will also need to edit the alias in your .bash_aliases file to match the changed directory.
Example:
If I moved bgf to ~/tools/ then I need to source the directory like so:
~/tools/bgf/patterns.sh
I will continue to add to this as gf updates.