mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-23 00:57:15 +00:00
28 lines
343 B
Plaintext
28 lines
343 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
function parse() {
|
||
|
version=$1
|
||
|
|
||
|
read -r
|
||
|
while [ -z "`echo $REPLY | grep -e "^#\+ $version"`" ]
|
||
|
do
|
||
|
read -r
|
||
|
done
|
||
|
|
||
|
read -r
|
||
|
while [ -z "`echo $REPLY | grep -e "^#\+"`" ]
|
||
|
do
|
||
|
echo "$REPLY"
|
||
|
read -r
|
||
|
done
|
||
|
}
|
||
|
|
||
|
version=$1
|
||
|
file=$2
|
||
|
|
||
|
if [ -n "$file" ]; then
|
||
|
parse $version < "$file"
|
||
|
else
|
||
|
parse $version
|
||
|
fi
|