Dont replace variable

So I have a post-deploy script that writes to a file, an rsyslog config file to be exact. The file needs to have the litteral text $programname written to it. I dont have an octopus variable set for programname, so why is $programname getting removed in my post deploy script?

Hi @brandon1

I saw you discussing this on our Community slack channel, and would just like to put the solution to this here, in case anyone hit this again - Bash uses the $variable notation for variables - in order to utilize a literal $variable in your script, you will need to escape it, as \$variable.

Hope this helps others who might get caught by this bash (and powershell) gotchya.

1 Like

Yup! \$variableName will not touch $variableName

1 Like