tusharsadhwani / piston_bot

A Telegram bot that will run code for you.
MIT License
49 stars 11 forks source link

'sh' alias should run bash in POSIX compat mode #17

Open ztx-lyghters opened 10 months ago

ztx-lyghters commented 10 months ago

Hello. /bin/sh historically used to be (and continues to be on some distros) a POSIX or "Bourne" shell specifically, for this reason when bash executes shell script with a /bin/sh shebang, it enters "POSIX mode". Specifying "sh" as a language in the bot doesn't invoke such behavior and runs a standard bash instead of this.

The suggestion is for "sh" alias to run "bash --posix $@" instead. This would be very helpful to have.

ztx-lyghters commented 10 months ago

https://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html

tusharsadhwani commented 10 months ago

Interesting!

I'm wondering why does the backend itself doesn't do that. Maybe this should be an issue on piston itself?

If not, I'd be happy to look into this.

ztx-lyghters commented 10 months ago

Thanks for considering this. I've never used Piston itself, I will have to investigate that.