I am trying to list the names of the variables that I have declared in my script, so I have been trying with different combinations of:
( set -o posix ; set ) | less
But I am not getting the result that I expected. It gives me an ouput with all variables in addition to my script´s variables. I do not know if I am using this command in the correct way. My intention is to only list the variables´ names that I have declared in my script and get an output like this:
VAR1
VAR2
VAR3
VAR4
…