You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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). 🙂
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:aws-cli/awscli/alias.py
Line 283 in 85d72cd
Other Information
No response
Acknowledgements
CLI version used
2.11.12
Environment details (OS name and version, etc.)
The text was updated successfully, but these errors were encountered: