Avoiding error message '[: too many arguments'
Change-Id: I0253723078f5c3e77debfd8a8138559878544959
This commit is contained in:
parent
87aa9c03fd
commit
df201fd6b5
|
@ -42,12 +42,12 @@ function iniset {
|
|||
local file=$4
|
||||
local line
|
||||
|
||||
if [ -z $section ] ; then
|
||||
if [ -z "$section" ] ; then
|
||||
# No section name specified
|
||||
sed -i -e "s/^\($option[ \t]*=[ \t]*\).*$/\1$value/" "$file"
|
||||
else
|
||||
# Check if section already exists
|
||||
if [ ! grep -q "^\[$section\]" "$file" ]; then
|
||||
if [ ! $(grep -q "^\[$section\]" "$file") ]; then
|
||||
# Add section at the end
|
||||
echo -e "\n[$section]" >>"$file"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue