Lets supose some bash shell script like:#!/bin/bash a=3b=7set -o posixsetIn this case, the execution of the set variable or some other of the commands to print environment variables (env,declare... etc) outputs my a and b variables, plus a lot of variables (and functions) from the environment (PATH, PWD, TEMP... etc).Is there a way to print only those variables that have been defined during the script body?
How can I print only variables defined inside my shell script?
shell;scripting;variable