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

commands on mac fails #49

Closed
albfan opened this issue Oct 1, 2024 · 2 comments
Closed

commands on mac fails #49

albfan opened this issue Oct 1, 2024 · 2 comments

Comments

@albfan
Copy link

albfan commented Oct 1, 2024

complex commands (like arguments with spaces) fail execution on mac.

Is not due to mac itself but due to use of sudo su - $USER -c "command $@"

@albfan
Copy link
Author

albfan commented Oct 1, 2024

There're several solutions:

  • avoid arguments with spaces, with 2 options:
    • not use spaces at all: turn negated arguments "! microshift-preset" to exclusive arguments "openshift-preset"
    • negate arguments without spaces "!microshift-preset". In this case to avoid bash expansion use '!microshift-preset'
  • Use ${@@q}
    ```
    For the @q parameter transformation:

The expansion is a string that is the value of parameter quoted in a format that can be reused as input.

      This requires to use eval, like eval "${@@Q}". Evaluate if passing this argument initially might solve all cases without using eval

@albfan
Copy link
Author

albfan commented Oct 2, 2024

Closing (by now resolved with crc-org/crc#4383)

@albfan albfan closed this as completed Oct 2, 2024
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

1 participant