Simple grep Wrapperby J. Edward Durrett
Unix/Linux / text searching
grep someword /path/file
grep anotherword /path/file
grep yetanotherword /path/file
That is a lot of typing and it can go on for a while. There are of course some shell tricks to make it less
typing, like using the up arrow key, but I wanted something that was even faster. So I wrote this very simple
script (also available at github https://github.com/durrettj/gwrap/:
while [ "$search" != "!q" ]; do
printf "\n\nEnter search term/phrase or '!q' to exit: "
printf "Results of search:\n\n"
grep -r "$search" $file | more
Now if I have some logfile or a directory full of emails, I can quickly run a couple of word searches to find what
I am looking for. This really helps when searching less predictable human generated text where multiple words have
Copyright (c) 2019, Jason Edward Durrett - All content on this site, unless otherwise noted, is subject to this license.
Please contact me if any errors, such as erroneous / misleading content or missing / incomplete attribution, are found.