[gnu.bash.bug] bash doesn't handle ${<number>:-<stuff>} correctly...

tmb@AI.MIT.EDU (Thomas M. Breuel) (12/09/89)

See the following transcript
team$ seq 1 10 | head -15           <--- using bash
1 9999999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Broken pipe
team$ sh seq 1 10                   <--- using /bin/sh
1 10
1
2
3
4
5
6
7
8
9
10
team$ cat seq
from=${1:-1} <-------+-------------- these substitutions probably fail
to=${2:-9999999} <---/
echo $from $to
awk 'BEGIN{for(i='$from';i<='$to';i++) print i; exit}'
team$ 

chet@cwns1.CWRU.EDU (Chet Ramey) (12/12/89)

In article <8912090351.AA00729@team> tmb@AI.MIT.EDU (Thomas M. Breuel) reports
that stuff like ${1:-1} fails.

I have already sent a fix for this to Brian.  Here's the output I get:

usenet$ sh seq 1 10
1 10
1
2
3
4
5
6
7
8
9
10
usenet$ bash seq 1 10
1 10
1
2
3
4
5
6
7
8
9
10

Chet Ramey

-- 
Chet Ramey
Network Services Group				"Where's my froggie?"
Case Western Reserve University
chet@ins.CWRU.Edu