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

Bug#621121: bash: Test text equivalency and parameter expansion fails - example included



(resending because I forgot to cc the release-notes maintainers.
 Sorry for the noise, Dean.)
reassign 621121 release-notes
tags 621121 + squeeze
quit

Hi Dean,

Dean Allen Provins wrote:

> Text equivalency should use '==' (as per man page and before Deb 6), 
> but now needs '='.
>
> Parameter expansion as per man page uses ${param:start:length} and worked prior 
> to Debian 6, but now fails miserably.
> --------------Example code follows for file test.sh--------------
>
> #!/bin/sh

Please run

 # dpkg-reconfigure dash

and set bash as the system shell, and your scripts will work again.
Generally speaking, scripts with a /bin/sh shebang meant for wide use
should only use POSIX features[1] and the way to declare use of bash
features is "#!/bin/bash"; but in-house scripts using bash features
are definitely worth supporting without that change, and the above is
how.

Before squeeze you probably didn't run into problems because bash was
the default system shell.  Do you have any ideas about how we can make
this changed default more visible?  (It was documented in dash's
NEWS.Debian.gz but perhaps that is not visible enough.)

Thanks for reporting,
Jonathan

[1] http://unix.org/2008edition



Reply to: