Hacker News new | ask | show | jobs
by chasil 1362 days ago
Debian dash is useful to keep my scripts honest.

Busybox actually takes dash, and then sprinkles a few bash/korn features back onto it (notibly, not arrays).

If you want a lot of people to use your scripts, getting them working in dash can help a great deal.

The POSIX mode in bash exists because bash itself predates POSIX by nearly a decade.

2 comments

What does "keep my scripts honest" even mean? Just use bash and don't make everyone else boil your ocean.

It's like saying you'll never use any Linux feature except those strictly defined by POSIX.1. Why would you do that?

Android uses mksh. If I write a script that uses read -p to present a prompt, it will fail on Android because it means coprocess on mksh.

The fundamental reality is that GPL does not run on iOS or Android (in userland). If you want to run scripts on those platforms (and they are ENORMOUS), then you cannot use bashisms.

Full stop.

Note: BusyBox has two shell implementations in it, selected at compile time.