So I'm not sure why this is.. I know ${LINENO} normally contains the line in the script, and BASH_LINENO goes based on input from BASH_SOURCE as an array
$ (echo hi;declare -p LINENO BASH_LINENO;echo -e "My LINENO\tis\t${LINENO}\nMy BASH_LINENO\tis\t${BASH_LINENO[@]}")
hi
declare -- LINENO="34"
declare -a BASH_LINENO=()
My LINENO is 34
My BASH_LINENO is
But why when I am working interactively is LINENO coming back as 30+ then incrementing every time I run echo (note like when I am saying interactive I am meaning like this is an activate shell with pty attached and fd 0, 1, and 2 being there). Can anyone explain to me why LINENO is at 33, 34, 35 etc when running multiple times?
echo $LINENO, it shows 1 since that's the first input line. Run it again, it shows 2 since that's the second input line, etc.