On Wed, Nov 26, 2014 at 4:25 PM, Robin Sheat <robin@catalyst.net.nz> wrote:
Mark Tompsett schreef op wo 26-11-2014 om 15:49 [-0500]:
> QUESTION: Do all the koha command scripts need to be only sh?
>
For debian/ubuntu, except init scripts, bash is fine as it's required to
be installed.

My personal preference if to write the most portable code practical. As such, I'd prefer changing the prompt to "Press enter to continue.", and keep the hashbang set to #!/bin/sh, but that's more because I lean toward the old school "more portability is better" and less because I think that there's a *real* argument to be made there, given that we've already decided that debian is the standard platform for Koha... (and realistically, who *doesn't* have bash? You can run it under Windows, even).


For init scripts, ubuntu (last I heard) runs them under dash, which is
mostly but not totally the same.

dash is the Debian implementation of POSIX shell. It tends to adhere strictly to the POSIX standard. I would say that it should preferred over bash in the following cases:

* The script might, at some point in the future be run from /etc/init.d/
* The script itself is processor intensive - dash is faster than bash.

--Barton