Skip to content

Commit b2a6871

Browse files
committed
stronger parsing
1 parent e61ee85 commit b2a6871

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bin/v_change_sys_config_value

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# Argument defenition
1414
key=$(echo "$1" | tr '[:lower:]' '[:upper:]' )
15-
value=${2// /%spc%}
15+
value=$2
1616

1717
# Importing variables
1818
source $VESTA/conf/vars.conf

bin/v_list_sys_config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ source $VESTA/conf/vars.conf
1919
json_list_conf() {
2020
lines=$(wc -l $V_CONF/vesta.conf | cut -f 1 -d ' ')
2121
i='0'
22+
IFS=$'\n'
2223
echo -e "{\n\t\"config\": {"
2324
for str in $(cat $V_CONF/vesta.conf); do
2425
(( ++i))
2526
key=${str%%=*}
2627
value=${str#*=}
27-
value=${value//%spc%/ }
2828
if [ "$i" -lt "$lines" ]; then
2929
echo -e "\t\t\"$key\": \"${value//\'/}\","
3030
else
@@ -36,10 +36,10 @@ json_list_conf() {
3636

3737
# Shell function
3838
shell_list_conf() {
39+
IFS=$'\n'
3940
for str in $(cat $V_CONF/vesta.conf); do
4041
key=${str%%=*}
4142
value=${str#*=}
42-
value=${value//%spc%/ }
4343
echo "$key: ${value//\'/}"
4444
done
4545
}

0 commit comments

Comments
 (0)