Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$FUNCNAME alternative in /bin/sh

Tags:

shell

sh

Does the POSIX shell have something similar to $FUNCNAME in bash ?

like image 374
Andras P Avatar asked Dec 07 '25 22:12

Andras P


1 Answers

No. The list of variables which are required to have special behavior by the POSIX sh standard is quite small, and no equivalent to FUNCNAME is given; the closest thing is LINENO.

(If such a thing already existed in POSIX sh, why would bash have added its own rather than implementing the specification?)

like image 138
Charles Duffy Avatar answered Dec 10 '25 22:12

Charles Duffy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!