They gave me this:
Code:
#!/bin/bash # Write error message on stderr and die function die() { echo "$@" >&2 exit 1 } # Load var from properties files function load() { for propertie in "$@" ; do [[ -f "${propertie}" ]] || die "load() : \"${propertie}\" don't exist !" while read ; do echo "${REPLY%=*}" echo "${REPLY#*=}" [[ -n "${REPLY%%=*}" && -z "${REPLY#*=}" ]] || die "load() : Variable \"${REPLY%%=*}\" is empty!" eval "${REPLY%%=*}"=\'"${REPLY#*=}"\' done < "${propertie}" done } load "manage_srcds.conf" echo "SRCDS_TICKRATE=$SRCDS_TICKRATE" echo "SRCDS_SCREEN=$SRCDS_SCREEN" echo "SRCDS_SRCDS_GAME_NAME=$SRCDS_GAME_NAME" echo "SRCDS_MAXPLAYERS=$SRCDS_MAXPLAYERS"
but, return:
Quote:
###################################################
###################################################
load() : Variable "###################################################" is empty!
cat manage_srcds.conf
I just wish that there was no empty variable excluding those who do not have integer.
Best regards,