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

Quoting on echo to Shell Init Files #17

Open
craigsadler opened this issue May 19, 2022 · 1 comment
Open

Quoting on echo to Shell Init Files #17

craigsadler opened this issue May 19, 2022 · 1 comment
Assignees

Comments

@craigsadler
Copy link

It appears the quoting might be a different to allow the HOMEBREW_PREFIX variable to properly resolve to its contents in the tee command:

echo 'export PATH="${HOMEBREW_PREFIX}/opt/openssl/bin:$PATH"'

results in shell files getting:

export PATH="${HOMEBREW_PREFIX}/opt/openssl/bin:$PATH"

While,

echo 'export PATH='"${HOMEBREW_PREFIX}/opt/openssl/bin:$PATH"

Does what is intended, i.e. shell files get a good PATH assignment.

export PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

@Honestpuck
Copy link
Owner

Actually, that won't quite do it. We need the '$PATH' to be expanded as late as possible so it needs to be in the rc files as $PATH.

I will do some experimentation over the weekend. but I suspect

echo 'export PATH="'"${HOMEBREW_PREFIX}"'/opt/openssl/bin:$PATH"'

might do the trick, at the same time allowing for a space in either HOMEBREW_PREFIX or PATH

@Honestpuck Honestpuck self-assigned this Dec 20, 2023
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

No branches or pull requests

2 participants