File: debugfind

package info (click to toggle)
haproxy 1.7.5-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,364 kB
  • ctags: 8,494
  • sloc: ansic: 92,976; xml: 1,754; sh: 1,227; python: 1,005; makefile: 831; perl: 550
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