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

Allow to specify shell for bash scripting #7920

Open
1 of 2 tasks
dantonyuk opened this issue May 26, 2023 · 2 comments
Open
1 of 2 tasks

Allow to specify shell for bash scripting #7920

dantonyuk opened this issue May 26, 2023 · 2 comments
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue

Comments

@dantonyuk
Copy link

Describe the feature

Currently bash scripting aliases use /bin/sh to execute the code. Unfortunately, on different systems it's different shells. E.g. it's bash v3 on Macos, and dash on Ubuntu/PopOs. It hinders creating portable aliases.

Use Case

I share my dotfiles among the devices I use, and it's really hard to write scripts that could be executed on all the systems. E.g. dash does not support arrays so I have to write cumbersome code to emulate it. With the ability to specify the shell I'd write the scripts only for this particular shell.

Proposed Solution

Allow to specify shell for aliases and pass it as shell parameter here:

return self._invoker(command, shell=True)

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CLI version used

2.11.12

Environment details (OS name and version, etc.)

@dantonyuk dantonyuk added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 26, 2023
@tim-finnigan
Copy link
Contributor

Thanks @dantonyuk for the feature request. I found a related one here requesting PowerShell support for aliases: #4285. We may want to consolidate these issues for tracking going forward. More investigation is needed into how the team might approach implementing these feature requests.

@tim-finnigan tim-finnigan added p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels May 30, 2023
@vergenzt
Copy link

This would have been helpful for making my workaround at aws/amazon-ssm-agent#358 (comment). However I worked around this limitation by just invoking bash from within the alias (to use its ${*@Q} parameter re-quoting feature). 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants