oksh icon indicating copy to clipboard operation
oksh copied to clipboard

`shift $#` inside for loop without `in word...` part breaks the parameter list

Open oguz-ismail opened this issue 3 years ago • 1 comments

To reproduce, put the following into a file (say, foo),

for x; do
  shift $# 
  echo $x
done

and run:

$ oksh ./foo x y z
x
y
./foo

No other shell does this except mksh.

oguz-ismail avatar Oct 20 '21 05:10 oguz-ismail

Thank for the report. This is one where I'll ask you to please confirm that the behavior is the same with the in-base ksh on OpenBSD (I suspect it is) and send an email to their bugs@ list. And I'll merge the fix from there.

ibara avatar Oct 20 '21 11:10 ibara