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 wrong order of parameter expansion #1

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

Conversation

Optimierungswerfer
Copy link

Since some time (unfortunately, I could not figure out why or since when exactly) the script stopped working. It turned out that the $p variable had been empty inside the "cd" and "%my_app%" commands after being defined in the launch command. After some fiddling, it became clear that $p was being expanded too early and in the same context as the "bash -i -c" command before "bash -i -c" even started its work. This is solved by escaping the parameter expansion (as well as the sub-shells inside the launch command) once with a backslash. Also see the added comment part.

Since some time (unfortunately, I could not figure out why or since when exactly) the script stopped working. It turned out that the $p variable had been empty inside the "cd" and "%my_app%" commands after being defined in the launch command. After some fiddling, it became clear that $p was being expanded too early and in the same context as the "bash -i -c" command before "bash -i -c" even started its work. This is solved by escaping the parameter expansion (as well as the sub-shells inside the launch command) once with a backslash. Also see the added comment part.
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