ksh: eval: syntax error: `((' unexpected
Hi, i’ve got an error (eval: syntax error: `((’ unexpected ) on u+m (but working), while working fine on u+ 2012. Now i’m not sure is it my fault or bug. u+m is yesterday compilation.
integer i=0
for .. in ..
...
((i++))#error
What is more funny, if i redirect error to /dev/null it doesn’t show error on u+m but stops working on u+ 2012: ((i++)) 2> /dev/null
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16
Commits related to this issue
- Updated form supporting one argument — committed to posguy99/shellbits by posguy99 3 years ago
There was another silly mistake in the last version, here’s a corrected one. @DesantBucie @posguy99
Try this. This version of the trap action assumes that
${.sh.command}
will contain either properly shellquoted command arguments, or an arithmetic command starting with((
(but it’s enough to check for the initial(
as that alone would be a syntax error to eval after a prefix word). It also refuses to eval or run the function if the shell is not interactive, or if we’re currently executing a function (if${.sh.level}
is nonzero).This does actually work on ksh 93u+, but not if you define a complicated prompt (such as your own) that executes command substitutions, as that kills the
DEBUG
trap on 93u+ due to one of the many bugs with that. Those bugs have been fixed on 93u+m.edit: Silly mistake:
$1 != \(*
should be${.sh.command} != \(*
.