File: debugfind

package info (click to toggle)
haproxy 1.3.15.2-2%2Blenny2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,780 kB
  • ctags: 2,264
  • sloc: ansic: 21,832; perl: 543; sh: 407; makefile: 339; xml: 124
file content (8 lines) | stat: -rw-r--r-- 229 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
#!/bin/bash
if [ $# -lt 2 ]; then
	echo "Usage: $0 regex debug_file > extracted_file"
	exit 1
fi
word=$1
file=$2
exec grep $(for i in $(grep $word $file |cut -f1 -d: | sort -u ) ; do echo -n '\('$i':\)\|'; done; echo '^$') $file