This file contains hidden or 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
| #!/bin/bash | |
| # The code below does the following: | |
| # 1. Loop through each .sql file | |
| # 2. Loop through each line in each file | |
| # 3. If the line contains the word, then print the next word. | |
| # | |
| # invoke with: ./get_following_word.sh <word> | |
| # | |
| for file in ./**/*.sql; do | |
| awk '{for (I=1;I<NF;I++) if ($I == word) print $(I+1)}' word="$1" "${file}" |
NewerOlder