adding lineno implementation

daggs daggs at gmx.com
Mon Jan 15 09:52:14 UTC 2018


Greetings,

I'm trying to add LINENO implementation to hush, I've decided to check for new lines in i_getch calls and it seems to work but with one bug, in loops, the value gets updated wrongly.

here is my test output:
#!/bin/bash

t=0

echo "at line ${LINENO}"
while [ ${t} -lt 10 ]; do
echo "at line ${LINENO}"
       t=$((t+1))
done
echo "at line ${LINENO}"

echo "hello world ${t}"

bash output:
at line 5
at line 7
at line 7
at line 7
at line 7
at line 7
at line 7
at line 7
at line 7
at line 7
at line 7
at line 10
hello world 10

hush output:
at line 5
at line 9
at line 9
at line 9
at line 9
at line 9
at line 9
at line 9
at line 9
at line 9
at line 9
at line 10
hello world 10

all the line 9 prints are the print within the loop.

any ideas why?

Thanks,

Dagg.


More information about the busybox mailing list