reddec / trusted-cgi

Lightweight runner for lambda functions/apps in CGI like mode
https://trusted-cgi.reddec.net
MIT License
218 stars 16 forks source link

replace 'sh' for 'bash' in docker container #20

Closed c-nv-s closed 1 year ago

c-nv-s commented 1 year ago

In trying to avoid creating temporary files to store data which could just be kept in variables it is possible in bash to use the following syntax of process substitution and input redirection in order to pass data onto other commands:

{ read -d '' result ; }< <( curl http://myjsonapi.com/page1 | jq '.[0].somedatapoint' ) && anothercommand <<< "$result"

unfortunately this syntax isn't supported in 'sh' and an unexpected redirect error is received. Is it possible to use bash in the docker containers instead.

reddec commented 1 year ago

Could you please elaborate?

I suppose you can just use #!/usr/bin/env bash. I also added bash to the full image

reddec commented 1 year ago

I am closing the issue for now. Feel free to re-open it.

c-nv-s commented 1 year ago

thanks for this, and thanks again for the very useful project