We've noticed a bug in ksh93 this weekend related to reporting of line
numbers in errors and $LINONO:
Some of our big data production systems generate scripts to handle a
specific task. Because of the size and amount of datasets at CERN, it
is possible to get well beyond 2^32 lines in a generated script. We've
noticed that if the script is sufficiently long (> 2^32 lines) the
line numbers reset either to 1 or become random numbers

ksh -c 'integer i imax ; ((imax=2**33)) ; for ((i=0; i < imax ;
i+=1024 )) ; do printf
"#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#
%x\n" i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i
; done' >bigscript.sh
# now add error at the end
echo "))l/" >>bigscript.sh

If I run this I get line number 1:
bigscript.sh: syntax error at line 1: `)' unexpected

It would be nice to correct this and use int64_t from <stdint.h> as
default datatype for line numbers.

Lionel
_______________________________________________
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to