Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix escaping of PS1 #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nielslaukens
Copy link

@nielslaukens nielslaukens commented Jun 20, 2017

When traveling from the puppet manifest to the actual PS1 variable, a
number of (un)escaping cycles happen:

  • we want these 2 characters in PS1: '\$'
  • Since PS1 is set as a double quoted string, we need to escape both the
    backslash and the dollar (to prevent variable expansion): "\\\$"
  • Puppet adds an additional layer of escaping. It's a single quoted
    string, so only the backslashes need escaping: '\\\\\\$'

When traveling from the puppet manifest to the actual PS1 variable, a
number of (un)escaping cycles happen:
* we want these 2 characters in PS1: '\$'
* Since PS1 is set as a double quoted string, we need to escape both the
  backslash and the dollar (to prevent variable expansion): "\\\$"
* Puppet adds an additional layer of escaping. It's a single quoted
  string, so only the backslashes need escaping: '\\\\\\$'
@zipkid zipkid deleted the bugfix/PS1-escaping branch February 4, 2021 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant