involved in the `for' list, the list was recorded twice, leading to incorrect
argument expansion.
Introduce ifsfree() function that free's the IFS region list, GC'ing duplicated
code.
sleep
cmd='set `type "sleep"`; eval echo \$$#'
which=`eval $cmd`
echo $which
because the region did not get recorded at all, and it was interpreted as
a single word. I modified the code to keep track when the result of a
backquote expansion has been recorded to avoid recording it twice. I still
feel that this is not the right fix... More to come.
assignment. E.g.
echo ${foo:=`echo 1 2 3 4`}
prints:
1 2 3 1 2 3 4
because when the arquments are not quoted, the backquote result
gets recorded twice. The fix right now is to comment out the
record_region() call in expbackq(). I hope that it does not break
anything else.
- treat $0 specially since it is not in shellparams
- check the number of parameters instead of walking
the parameters array to avoid checking against the
null terminated element.
set -- ""; echo ${1:-wwww} works.
- when expanding arithmetic, discard previous ifs recorded regions, since we
are doing our own scanning. x=ab; echo $((${#x}+1)) now works.
- in ${var#word} fix two bugs:
* if there was an exact match, there was an off-by-one bug in the
comparison of the words. x=abcd; echo ${x#abcd}
* if there was no match, the stack region was not adjusted and the rest
of the word was getting written in the wrong place. x=123; echo ${x#abc}X
false
foo=bar
echo $?
would print 1
Also fixed the long standing bug:
false
echo `echo $?`
would print 0
The exitstatus needs rethinking and rewriting. The trial and error method
is not very efficient
begin with a space, but contains one. Fixes PR bin/809.
#!/bin/sh
list="a b c "
echo "With ordinary IFS"
for i in $list;do
echo $i
done
IFS=":${IFS}"
echo "With changed IFS"
for i in $list;do
echo $i
done
Note that before the fix ":${IFS}" behaved differently than "${IFS}:".