Ticket #538: functions-parse.sh.diff

File functions-parse.sh.diff, 1.9 KB (added by glarkin, 3 years ago)
  • functions-parse.sh

    old new  
    3333{ 
    3434  if [ ! -z "${1}" ] 
    3535  then 
    36     VAL="`echo ${1} | cut -d '=' -f 2`" 
     36    VAL="`echo ${1} | cut -d '=' -f 2-`" 
    3737    export VAL 
    3838  else 
    3939    echo "Error: Did we forgot to supply a string to parse?" 
     
    4646{ 
    4747  if [ ! -z "${1}" ] 
    4848  then 
    49     VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2` 
     49    VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2-` 
    5050    export VAL 
    5151  else 
    5252    exit_err "Error: Did we forgot to supply a setting to grab?" 
     
    5959{ 
    6060  if [ ! -z "${1}" ] 
    6161  then 
    62     VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` 
     62    VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2- | tr -d ' '` 
    6363    export VAL 
    6464  else 
    6565    exit_err "Error: Did we forgot to supply a setting to grab?" 
     
    7474  then 
    7575    # Get the first occurance of the setting from the config, strip out whitespace 
    7676 
    77     VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` 
     77    VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2- | tr -d ' '` 
    7878    if [ -z "${VAL}" ] 
    7979    then 
    8080      # This value doesn't exist, lets return 
     
    107107  if [ ! -z "${1}" -a ! -z "${2}" ] 
    108108  then 
    109109    # Get the first occurance of the setting from the config, strip out whitespace 
    110     VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` 
     110    VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2- | tr -d ' '` 
    111111    VALID="1" 
    112112    for i in ${2} 
    113113    do 
     
    136136      grep "^${i}=" $CFGF >/dev/null 2>/dev/null 
    137137      if [ "$?" = "0" ] 
    138138      then 
    139         LN=`grep "^${i}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` 
     139        LN=`grep "^${i}=" ${CFGF} | head -n 1 | cut -d '=' -f 2- | tr -d ' '` 
    140140        if [ -z "${LN}" ] 
    141141        then 
    142142          echo "Error: Config fails sanity test! ${i}= is empty"