I am trying to figure out how to solve a problem with a "$" causing command expansion as part of a password field. How do you backslash the "$" when using command substitution (unknown) arguments? (i.e. $1, $2)
For example, in a script called 'testPass':
If I type in:
Then the output is:
I have also tried single quotes (echo '$PASSWORD') as most people say online, however this just prints:
I have even tried using the printf command, which has also been mentioned online, as so:
printf '%q\n' '$PASSWORD'
However this does something similar, with the following output:
I have searched for a long time to figure this out, however I am new to UNIX so I could be missing something I am unaware of. Please let me know if you have any ideas, thank you.