acoeur/bin/_commands/_extract.sh

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'
}