Greetings, After faking out my development environment (may have gotten the commands wrong, since ln trips me up sometimes): $ sudo ln -s ~/koha-dev/etc /etc/koha $ cd ~/koha-dev/etc $ mkdir sites $ mkdir library $ ln -s ~/koha-dev/etc/koha_conf.xml koha_conf.xml $ cd /usr/share $ sudo mkdir koha $ cd koha $ sudo ln -s ~/kohaclone/debian/scripts bin QUESTION: Is this too evil? I attempted to: $ git bz apply 13413 $ ./debian/scripts/koha-passwd library Now it worked, but... “Press any key to clear the screen...” wasn’t any key, it required enter/return. Currently it is a sh script. If we made it bash, the line: read anykey could become: read -N1 anykey And then it really would be any key. QUESTION: Do all the koha command scripts need to be only sh? GPML, Mark Tompsett
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. For init scripts, ubuntu (last I heard) runs them under dash, which is mostly but not totally the same. -- Robin Sheat Catalyst IT Ltd. ✆ +64 4 803 2204 GPG: 5FA7 4B49 1E4D CAA4 4C38 8505 77F5 B724 F871 3BDF
On 2014-11-27, at 10:25 AM, Robin Sheat 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.
+1 for bash
For init scripts, ubuntu (last I heard) runs them under dash, which is mostly but not totally the same.
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
participants (4)
-
Barton Chittenden -
Mark Tompsett -
Mason James -
Robin Sheat