I have a list of java reserved words, first letter capitalised.
$ tail -n5 ~/reservedjava.txt
Break
While
True
False
Null
I'm trying to look through all my java source code to find methods that look like
getWhile()
.
cat ~/reservedjava.txt | parallel 'ag "get{}\(\)$"'
This shows me nothing. Now, I know that I have a method getBreak()
:
$ ag "getBreak\(\)$"
src/main/java/Foo.java
154: public Break getBreak()
Here's what a dry run looks like:
$ cat ~/reservedjava.txt | parallel --dry-run 'ag "get{}\(\)$"' | tail -n5
ag "getBreak\(\)$"
ag "getWhile\(\)$"
ag "getTrue\(\)$"
ag "getFalse\(\)$"
ag "getNull\(\)$"
I'm using gnu parallel (v. 20130722) and the silver searcher (ag) (v. 0.18.1). If it makes a difference, I'm on Fedora 19, but have compiled these utilities myself. I get the same result with ack (v. 2.12).
Asked by djeikyb
(348 rep)
Jan 8, 2014, 10:00 PM
Last activity: Sep 13, 2017, 10:49 AM
Last activity: Sep 13, 2017, 10:49 AM