Unset variable with characters in value

I have a script with a $PASSWORD variable. I unset it right after using it, just to minimize the chance it could be left around for a snooper. That worked just fine... until I used a password with a value of "P@ssw0rd" Now, unset (even with -f, even with the variable enquoted) tells me: unset: `P@ssw0rd': not a valid identifier

That is likely a bug in your script. Show it, please.

unset $PASSWORD is wrong. unset PASSWORD is what you want, I think.

1 Like