work in alternative shells #43

Closed
opened 2025-12-29 00:23:13 +01:00 by adam · 4 comments
Owner

Originally created by @crick-ru on GitHub (Jan 30, 2016).

Originally assigned to: @lukas2511 on GitHub.

It would be very nice if the script will run in alternative shells. For example, in busybox ash.
Now it is not working.

Originally created by @crick-ru on GitHub (Jan 30, 2016). Originally assigned to: @lukas2511 on GitHub. It would be very nice if the script will run in alternative shells. For example, in busybox ash. Now it is not working.
adam closed this issue 2025-12-29 00:23:13 +01:00
Author
Owner

@lukas2511 commented on GitHub (Feb 6, 2016):

This is related to #109.

I think it's best trying to get this script somewhat posix compliant as this way it should work in quite a lot of shells.

@lukas2511 commented on GitHub (Feb 6, 2016): This is related to #109. I think it's best trying to get this script somewhat posix compliant as this way it should work in quite a lot of shells.
Author
Owner

@lukas2511 commented on GitHub (Feb 10, 2016):

Initial zsh compatiblity was added in da2eeda97d.

Will continue working on compatibility with some other shells.

I think busybox ash (as you suggest) would be a good next target so this script works on embedded systems with openwrt, angstrom, alpine, etc.

@lukas2511 commented on GitHub (Feb 10, 2016): Initial zsh compatiblity was added in da2eeda97d04817b895a6c85e72d5c5d53e32241. Will continue working on compatibility with some other shells. I think busybox ash (as you suggest) would be a good next target so this script works on embedded systems with openwrt, angstrom, alpine, etc.
Author
Owner

@lukas2511 commented on GitHub (Feb 10, 2016):

I just had a look at busybox ash and I don't think porting this script is worth it.
Ash really lacks a lot of features, which would require a ton of workarounds....

I'm closing this ticket now since there already is support for at least one other shell (zsh), and I guess it would work in some others too.
If there are (minor) issues with other shells there should be new tickets created instead of adding to this.

@lukas2511 commented on GitHub (Feb 10, 2016): I just had a look at busybox ash and I don't think porting this script is worth it. Ash really lacks a lot of features, which would require a ton of workarounds.... I'm closing this ticket now since there already is support for at least one other shell (zsh), and I guess it would work in some others too. If there are (minor) issues with other shells there should be new tickets created instead of adding to this.
Author
Owner

@bittorf commented on GitHub (Feb 11, 2016):

i was testing the script under busybox.
i dont see too much problems fixing it for POSIX (so working in every shell):

e.g. these calls (there are a lot of)

csr64="$( <<<"${csr}" openssl req -outform DER | urlbase64)"

can be converted to:

csr64="$( echo "${csr}" | openssl req -outform DER | urlbase64)"

another thing are:

[[ var =~ (foo|bar)$ ]] || ...

which can be written as:

case "$var" in
  *foo|*bar);;
  *) ... ;;
esac

another things are arrays, e.g. ${deploy_args[@]} where we can make a small function

@bittorf commented on GitHub (Feb 11, 2016): i was testing the script under busybox. i dont see too much problems fixing it for POSIX (so working in every shell): e.g. these calls (there are a lot of) ``` csr64="$( <<<"${csr}" openssl req -outform DER | urlbase64)" ``` can be converted to: ``` csr64="$( echo "${csr}" | openssl req -outform DER | urlbase64)" ``` another thing are: ``` [[ var =~ (foo|bar)$ ]] || ... ``` which can be written as: ``` case "$var" in *foo|*bar);; *) ... ;; esac ``` another things are arrays, e.g. ${deploy_args[@]} where we can make a small function
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#43