Query one variable quickly with bitbake-getvar
bitbake-getvar prints one variable's value for a recipe without dumping the whole environment, on Scarthgap 5.0.
The documented way to read a variable is bitbake -e | grep, which parses the recipe, expands thousands of variables and prints them all. bitbake-getvar is the quiet alternative that most guides skip: it does the same expansion and prints only the variable you ask for. With -r it targets a recipe, and --value drops the NAME="..." wrapper so the result can feed a script. This was written for Scarthgap 5.0 with BitBake 2.8.
bitbake-getvar -r busybox PV
bitbake-getvar -r busybox --value WORKDIRPV="1.36.1"
/build/tmp/work/cortexa72-poky-linux/busybox/1.36.1Without -r the command reads the global configuration, which is right for variables such as MACHINE or DL_DIR. Add --flag to read a variable flag and --quiet to suppress the parse messages when the output is parsed by a script. It still starts the BitBake server and parses the layers, so it is faster than -e but not instant. The path above is an example and will differ on your build host.