Skip to content

Fix wrong order of parameter expansion#1

Open
IMFJS wants to merge 1 commit into
mangelozzi:masterfrom
IMFJS:patch-1
Open

Fix wrong order of parameter expansion#1
IMFJS wants to merge 1 commit into
mangelozzi:masterfrom
IMFJS:patch-1

Conversation

@IMFJS

@IMFJS IMFJS commented Dec 9, 2021

Copy link
Copy Markdown

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