I have a giant script that I'm attempting to debug, and in it it has the following construction:
var "-p Some Parameter" || return 1
var "-p Other Parameter" || return 0
I want to know what it actually executes (and I know it executes something since I get error message from whatever var is), but when I do echo $var
or echo ${var}
etc, it gives me empty strings. echo "${!var}"
doesn't work ("syntax error: bad substitution") and if I do
eval e="\$$var"
echo $e
it just prints "$"
Is there any way to find out what a variable is actually equal to in ash, or is there some sort of tracing that would allow me to see what actual commands the script executes (that's available on Alpine)?