lgsm local mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

19 lines
564 B

# Game Settings File
# _parms
# Common parameter functions
apply_shell_expansion() {
declare file="$1"
declare data=$(< "$file")
declare delimiter="__apply_shell_expansion_delimiter__"
declare command="cat <<$delimiter"$'\n'"$data"$'\n'"$delimiter"
eval "$command"
}
# Process parameter list
fn_process_parmlist(){
prefix=$1
file=$2
# Expand variables, remove empties, strip = and " and prefix argument
echo $(printf "%s\n" "$(apply_shell_expansion "${file}")" | grep -v '=""' | sed -e "s/^\([^#=]\+\)=\"/${prefix}\1 /g" -e 's/\"$//g')
}