blob: e7ab391f88188295015b1959c35992ec9d474e60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/bin/bash
res=""
met=false
while IFS="" read str
do
if [ -z "${str##* *}" ]
then
key="${str%% *}"
val="${str#* }"
else
key="${str}"
val=""
fi
if [ -z "${key}" ] && [ $met == true ]
then
res="${res}"$'\n'"${val}"
elif [ "${key}" == "$1" ]
then
met=true
res="${val}"
else
met=false
fi
done
echo -n "${res}"
|