I like to make command-line bash variables for testing or for other purposes. I give them generic names like a
, b
, var1
... Sometimes I may forget which variables I've already used. Anyway, is there a single command to clear all bash variables? Now after running such a command, I want all bash variables that were defined by the user to become undefined. When echo $undefinedvariable
is run, the result is a blank line. All built-in variables like $USER
or $SHELL
should remain untouched by this command.
exec bash