Skip to content

Instantly share code, notes, and snippets.

@rafadavis
Created March 8, 2019 00:23
Show Gist options
  • Save rafadavis/6944880f6c87c4e83b718cfcd813076f to your computer and use it in GitHub Desktop.
Save rafadavis/6944880f6c87c4e83b718cfcd813076f to your computer and use it in GitHub Desktop.
bash_function_test
#!/bin/bash
# `chmod u+x search_script`
# to allow execution of script file
search_and_save () {
grep -A 2 -B 4 $1 *.txt > "$1".txt
}
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment