mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 05:59:43 +02:00
dsv (setup): make sure file ends with a newline, so that we can "read" it
This commit is contained in:
parent
be269982f3
commit
f207be6671
8
dsv/dsv
8
dsv/dsv
@ -102,6 +102,11 @@ setup()
|
||||
echo "$n: not found" 2>&1
|
||||
continue
|
||||
fi
|
||||
#
|
||||
# "read" doesn't recognize lines that don't end with a newline.
|
||||
# The cat-sed hack below works around this problems.
|
||||
#
|
||||
cat -E "$n" | sed 's/[^$]$/&\n/;s/$$//' | {
|
||||
while read line; do
|
||||
[ "$line" = "${line###}" ] || continue
|
||||
tmp=`echo "$line" | awk '/^[^\t ]/ { print $1 }'`
|
||||
@ -113,9 +118,10 @@ setup()
|
||||
tag=$tmp
|
||||
value=$tail
|
||||
fi
|
||||
done <"$n"
|
||||
done
|
||||
set_value
|
||||
eof
|
||||
}
|
||||
done
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user