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

Re: RE : Re: Bug#839210: ITP: bash-unit -- bash unit testing enterprise edition framework for professionals



On Wed, Oct 05, 2016 at 05:35:21PM +0200, Bart Schouten wrote:
> Pascal Grange schreef op 05-10-2016 9:32:
> >Regarding the fact that bash_unit only supports bash, this was a
> >design decision. I personally stumbled upon too many shell scripts
> >that started with:
> >
> >#!/bin/sh
> >
> >When they where actually using bash specific instructions or
> >constructs in the code.

Which doesn't work on Debian other than in non-standard configurations.

> >This testing tool supports bash and tries to support it well.
> 
> But do take note that on Debian systems there is also an interest to be Dash
> compatible. At least with me it is.
> 
> Particularly scripts that need speed can see great improvements sometimes
> under Dash.

Which is a reason to do so by default:
[~]$ grep '^#! */bin/bash' {/usr,}/{s,}bin/*|wc -l
72
[~]$ grep '^#! */bin/sh' {/usr,}/{s,}bin/*|wc -l
317
[~]$ grep '^#! */bin/dash' {/usr,}/{s,}bin/*|wc -l
0
(Lintian considers #!/bin/dash an error.)

While bash does have a lot of extensions, I for one never felt like learning
them and thus still write portable shell scripts (even if by laziness rather
than a conscious decision).  And really, the only times I feel angry enough
to change to #!/bin/bash is dash's lack of support of \e in printf[1].

Thus, by the above statistics, shunit2 is a lot more useful.


Meow!

[1].  All scripting languages I've checked support \e, so do all free C
compilers, and all shells other than dash -- even "Posixly correct" posh.
-- 
A MAP07 (Dead Simple) raspberry tincture recipe: 0.5l 95% alcohol, 1kg
raspberries, 0.4kg sugar; put into a big jar for 1 month.  Filter out and
throw away the fruits (can dump them into a cake, etc), let the drink age
at least 3-6 months.


Reply to: