Last active
May 17, 2016 20:57
-
-
Save wataruoguchi/6fbd2eab9d450addf89a7ed4feac8538 to your computer and use it in GitHub Desktop.
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 | |
| word="$@" | |
| datetime=$(date +'%Y%m%d%H%M%S') | |
| filename=$(echo $word | sed -r 's/(^| )([a-z])/\U\2/g'|tr '\n' ' ') | |
| filename=$(echo "grep_"$filename"_"$datetime".txt" | tr -d '[[:space:]]') | |
| find ./ -regex ".*\.php" -type f -print | xargs grep "$word" >> "$HOME/$filename" | |
| find ./ -regex ".*\.js" -type f -print | xargs grep "$word" >> "$HOME/$filename" | |
| echo "DONE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment