acoeur/bin/_commands/_extract.sh

12 lines
167 B
Bash
Raw Normal View History

2022-10-26 23:12:29 +02:00
#!/bin/sh
IFS='
'
extract() {
dir=$1 file=$2 key=$3
grep -A 100 "^$key:$" "$dir/$file" | grep -B 100 -m 2 "^\([^\-]\|\-\-\-\)" | grep "^\- " | sed 's/^- *//g'
}