That's the right command to set a shell variable. Or would be, in a POSIX shell. It doesn't actually export the variable to the environment of commands you run, though. To do that, you'd need export HELLO
in addition.
See e.g. Difference between shell variables which are exported and those which are not in bash for the difference.
Anyway, the error message you get appears to match the one tcsh
gives:
$ tcsh
~> HELLO="hello"
HELLO=hello: Command not found.
And it has a different language. Either use setenv HELLO "hello"
to set a variable exported to commands, or set HELLO = "hello"
for one that doesn't get exported. Or try to see if you can change your shell to something else (e.g. Bash or Zsh) if you want a POSIX-like shell instead.
export
to copy it into the environment. Do you know the difference? – Barmar Mar 12 '21 at 15:09$HELLO="hello"
, this is where I went wrong. – David Callanan Aug 26 '21 at 09:40