Is there a way for setting an environment variable in bash such that its value is not passed directly after = but is prompted for separately? For example, something akin to $ TEST=< (syntax does not actually work) instead of $ TEST=test.
Setting environment variables by prompt instead of in command line
bash;variable;interactive
As Stephen answered in the comments, shells that adhere to the POSIX spec will have a way to read input into a variable. bash includes several extra flag to the read built-in command, none of which you need for your situation:read TESTwill leave your terminal waiting for you to enter a line of input, which will be assigned to the TEST variable.