[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bashisms and Dashisms...



Hi,

A maintainer script with a #!/bin/sh line should only use posix
syntax. If one needs more features (e.g. test -L), one can instead use
#!/bin/bash.

However, this seems unnecessarily restricted to me. dash also knows
the non-POSIX extensions to the test builtin. So if /bin/sh pointed to
dash, my script would still run.

Is there any way to make this more liberal? A rule like "if it can be
executed by any of the bourne-shell clones A, B, C in Debian, it can be
used"? 

In other words: What is the purpose of the requirement that
/bin/sh-scripts may only use POSIXly correct syntax? Is the purpose to
allow custom distributions or local administrators to easily replace
/bin/sh with some smaller shell provided by Debian, and to easily
identify maintainer scripts that won't work then? Or is it rather that
also people outside Debian can make use of the code?

In the former case a check like I proposed above would make sense, in
the latter it wouldn't.

TIA, Frank
-- 
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie



Reply to: