Progress..

This commit is contained in:
Darren 'Tadgy' Austin 2019-07-16 21:38:27 +01:00
commit 161a886e19
6 changed files with 196 additions and 127 deletions

View file

@ -35,8 +35,8 @@ Valid 1
Valid 2
Valid 3
Valid 4
[ header 2 ]
[ header 2 ]
Valid 5
[ header 3 ]
[ header 3 ]
[header_____4____]
[ $%"%^ ]

View file

@ -4,19 +4,19 @@ shopt -s extglob
exec {FD}<readline.ini
#key2value() {
# # SECTION=
# KEY="$1"
#
# if [[ "${VALUE:0:1}" =~ [\"\'] ]]; then
# printf "%s" "${VALUE:1:-1}"
# else
# printf "%s" "$VALUE"
# fi
#}
key2value() {
KEY="$1"
if [[ "${VALUE:0:1}" =~ [\"\'] ]]; then
printf "%s" "${VALUE:1:-1}"
else
printf "%s" "$VALUE"
fi
}
while :; do
LINE=""
# LINE=""
unset LINE
while :; do
# The 'read' will remove leading whitespace from the line.
read -r -u $FD REPLY || break 2

7
bits/sections.ini Normal file
View file

@ -0,0 +1,7 @@
[section 1]
[section 2]
[ section 3 ]
[ section 4
[]
[ ]
[ ]