Last active
December 14, 2015 23:59
-
-
Save napsternxg/5169271 to your computer and use it in GitHub Desktop.
Search for text in files opened in the current folder in the current work space in Perforce. I would suggest using the part before the string passed to grep as an alias in your bashrc so you can use something like
grep_p4o "text to search" directly.
This file contains 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
alias grep_p4o='p4 opened | (folder="${PWD##*/}"; sed -e "s/.*${folder}\/\(.*\)#.*/\1/g") | xargs -o grep --color=auto -H' |
This file contains 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
p4 opened | (folder="${PWD##*/}"; sed -e "s/.*${folder}\/\(.*\)#.*/\1/g") | xargs -o grep --color=auto -H "text to search" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment