Alternative to "get" value from variable instead of capturing stdout
tomocafe opened this issue · comments
For example, if bb_getx()
prints the result to stdout, have bb_getx-v()
yield the same result in the variable $BB_RESULT
.
my_x="$(bb_getx)"
bb_getx-v
my_x2="$BB_RESULT"
bb_expect "$my_x" "$my_x2" # should be same
Or bb_getx-v VARNAME [getx args ...]
to put the value in VARNAME
. Use printf -v "$VARNAME" '%s' "$VALUE"
.