Package: dash
Version: 0.5.5.1-7.3
Severity: important
But, for word splitting, it shouldn't matter. Bash works as expected.
I flagged this "Severity: important" because this can potentially break a
lot of scripts.
Here is an example. The initial idea was to filter the list produced by
ip and pick up only the interfaces flagged LOWER_UP.
---8<---
#!/bin/dash
set -e
set -u
#set -x
IFS=': '
ip -o link show | while read n i s rest; do
echo n="|$n|", i="|$i|", s="|$s|", rest="|$rest|" >&2
done
--->8---
The unexpected output from the above is:
n=|2|, i=||, s=|eth0|, rest=| <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast state UP qlen 100 link/ether 00:13:20:b0:fd:f6 brd
ff:ff:ff:ff:ff:ff|
$i, the interface name is shifted to the next variable $s.
After swapping the IFS characters (IFS=' :'), I get the expected output:
n=|2|, i=|eth0|, s=|<BROADCAST,MULTICAST,UP,LOWER_UP>|, rest=|mtu 1500 qdisc
pfifo_fast state UP qlen 100 link/ether 00:13:20:b0:fd:f6 brd
ff:ff:ff:ff:ff:ff|
Thoughts?
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Versions of packages dash depends on:
ii debianutils 3.4.2 Miscellaneous utilities specific t
ii dpkg 1.15.8.6 Debian package management system
ii libc6 2.11.2-7 Embedded GNU C Library: Shared lib
dash recommends no packages.
dash suggests no packages.
-- debconf information excluded
Cheers,
--
Cristian
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]