Shell script

3 views
Skip to first unread message

youngblood.carl

unread,
Mar 30, 2009, 10:02:26 PM3/30/09
to Compojure
Hey Ya'll,

If you're ever wondering where something is defined, I put together
this shell script tonight. Just save it, chmod it to be executable,
and run ./foo.sh text-to-search-for

#!/bin/sh
find . -name "*.jar" | xargs -tn1 -I "%" sh -c 'jar tf "%" | grep .clj
| xargs -tn1 unzip -p "%" | grep -H --color '$1

I know the -H is extraneous in the final grep but I find the
formatting helps it stand out when it gets a hit.

Best,
Carl
Reply all
Reply to author
Forward
0 new messages