acoeur/bin/_commands/_extract.sh
2022-10-26 23:12:29 +02:00

12 lines
167 B
Bash
Executable File

#!/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'
}