Hello, Roberto,
I appreciate your useful efforts of adding the trap ERR feature. However, please allow me to comment on the LINENO behavior. > From: busybox <[email protected]> On Behalf Of Roberto A. Foglietta > Sent: Saturday, August 14, 2021 12:45 AM > > I prepared a test but feel free to improve it. Here the results: > > roberto@vm-ubuntu18:~/tinycore-editor/busybox$ src/busybox ash ./test2.sh > ash: using fallback suid method > ciao! at line 29 == 29 Fine! > hello at line 22 == 22 This output is produced from the command echo "hello at line $LINENO == 22" in the 2nd line of function mytest() which was sourced from file "funcs.sh" starting at line 21. From a usability point of view, the expansion 22 of $LINENO is not nice; a user confronted with that number might not even be aware from which file the function was sourced (it needn’t even be a persistent, regular file), so the POSIX specification for $LINENO to be set to the currently *executing* line number in a script or function is, in my opinion, much preferable. > ERROR: test2.sh failed at line 23, rc: 1 The same applies here for the command "false" in the 3rd line of mytest(), called from line 30 of "test2.sh". > onerror() at line 16 == 16 ... essentially the same here in the 5th line of function onerror(). > mytest should have failed at line 23 I think it shouldn’t. > pippo > ERROR: test2.sh failed at line 34, rc: 1 This is good. > onerror() at line 16 == 16 ... not so. > exit at line 34 == 34 with pippo but not pluto Fine! -- Best regards, Dietmar Schindler ________________________________ manroland Goss web systems GmbH | Managing Director: Franz Kriechbaum Registered Office: Augsburg | Trade Register: AG Augsburg | HRB-No.: 32609 | VAT: DE815764857 Confidentiality note: This message and any attached documents may contain confidential or proprietary information of manroland|Goss. These materials are intended only for the use of the intended recipient. If you are not the intended recipient of this transmission, you are hereby notified that any distribution, disclosure, printing, copying, storage, modification or the taking of any action in reliance upon this transmission is strictly prohibited. Delivery of this message to any person other than the intended recipient shall not compromise or waive such confidentiality, privilege or exemption from disclosure as to this communication. If you have received this communication in error, please immediately notify the sender and delete the message from your system. All liability for viruses is excluded to the fullest extent permitted by law. ________________________________
_______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
