ibara / oksh

Portable OpenBSD ksh, based on the Public Domain Korn Shell (pdksh).
352 stars 38 forks source link

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

Open oguz-ismail opened 2 years ago

oguz-ismail commented 2 years ago

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.

ibara commented 2 years ago

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.