File: debugfind

package info (click to toggle)
haproxy 1.5.8-3%2Bdeb8u2
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 8,248 kB
  • ctags: 6,924
  • sloc: ansic: 62,867; xml: 1,754; python: 925; makefile: 551; perl: 550; sh: 491
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