File: debugfind

package info (click to toggle)
haproxy 1.8.19-1%2Bdeb10u3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,472 kB
  • sloc: ansic: 121,842; javascript: 2,442; xml: 1,754; sh: 1,270; python: 1,015; makefile: 994; 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