Skip to content

Instantly share code, notes, and snippets.

@jrha
Last active December 22, 2015 05:19
Show Gist options
  • Save jrha/6423244 to your computer and use it in GitHub Desktop.
Save jrha/6423244 to your computer and use it in GitHub Desktop.
Use dep files to search the source files of a compiled panc object.
#!/bin/bash
if [[ "$#" -eq 2 ]]; then
if [[ "$1" == *.dep ]]; then
awk '! /ABSENT_SOURCE/ {sub("^[^:]*:", "", $3); print $3$1($2!="TEXT"?"."tolower($2):"")}' $1 | xargs grep $2
else
echo "DEP_FILE must be a pan dependency file"
fi
else
echo "Usage: searchprofile DEP_FILE NEEDLE"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment