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

Display executed command is broken on file concatenation #9

Closed
antonkomarev opened this issue Oct 22, 2019 · 2 comments · Fixed by #20
Closed

Display executed command is broken on file concatenation #9

antonkomarev opened this issue Oct 22, 2019 · 2 comments · Fixed by #20
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@antonkomarev
Copy link
Member

Command:

(set -x; cat ${OUTPUT_SERVER_CERTIFICATE} ${CA_CERTIFICATE} ${OUTPUT_SERVER_PRIVATE_KEY} > "${CERTIFICATE_CHAIN}")

Expected Output:

+ cat ./output/localhost.crt /usr/local/share/ca-certificates/!pric/ca.crt ./output/localhost.key > ~/localhost-certificate.pem

Actual Output:

+ cat ./output/localhost.crt /usr/local/share/ca-certificates/!pric/ca.crt ./output/localhost.key
@antonkomarev antonkomarev added bug Something isn't working help wanted Extra attention is needed labels Oct 22, 2019
@antonkomarev
Copy link
Member Author

antonkomarev commented Jun 23, 2020

To test it you could create a test file issue-9.sh:

echo "(set -x; cat /etc/hosts > /dev/null)" > issue-9.sh

And execute it:

sh issue-9.sh

Expected output:

+ cat /etc/hosts > /dev/null

Actual output:

+ cat /etc/hosts

@antonkomarev
Copy link
Member Author

antonkomarev commented Jun 23, 2020

There are possible workarounds, but I don't have enough time to dive deep and learn shell even more. So I made the simplest solution - just duplicated and echoed console command.

echo "+ cat ${OUTPUT_SERVER_CERTIFICATE} ${CA_CERTIFICATE} ${OUTPUT_SERVER_PRIVATE_KEY} > \"${CERTIFICATE_CHAIN}\""
cat ${OUTPUT_SERVER_CERTIFICATE} ${CA_CERTIFICATE} ${OUTPUT_SERVER_PRIVATE_KEY} > "${CERTIFICATE_CHAIN}"

If any body wants to improve it - here are some useful links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant