Bug#561675: dash: incompatibility with sh

2009-12-19 Thread Sergey Dorofeev
Package: dash
Version: 0.5.5.1-3
Severity: normal


so simple scripts stopped working after update to dash

#!/bin/sh

IFACE=$1
if [ $2 == up ]
then
  INS=-I
  ADD=-A
else
  INS=-D
  ADD=-D
fi

workaround: use bash

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dash depends on:
ii  debianutils   3.2.2  Miscellaneous utilities specific t
ii  dpkg  1.15.5.4   Debian package management system
ii  libc6 2.10.2-2   GNU C Library: Shared libraries

dash recommends no packages.

dash suggests no packages.

-- debconf information:
* dash/sh: true



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#561675: dash: incompatibility with sh

2009-12-19 Thread Alexey Gladkov
On 19.12.2009 16:48, Sergey Dorofeev wrote:
 #!/bin/sh
 
 IFACE=$1
 if [ $2 == up ]
  ^^

This is bashism.

Please, use = if you looking for portability.

 then
   INS=-I
   ADD=-A
 else
   INS=-D
   ADD=-D
 fi
 
 workaround: use bash

True :)

-- 
Rgrds, legion




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org