OILS / spec / testdata / bash-source-pushtemp.sh View on Github | oilshell.org

26 lines, 13 significant
1f() {
2 echo 'F'
3 ZZ=zz g
4 #g
5}
6
7g() {
8 echo 'G'
9
10 local n=${#BASH_SOURCE[@]}
11 for (( i = 0; i < n; ++i)); do
12 local src=${BASH_SOURCE[i]}
13
14 echo "STACK:$src:${FUNCNAME[i]}:${BASH_LINENO[i]}"
15 done
16}
17
18# TODO: enable these frames
19YY=yy f
20#f
21
22# These are wrong
23#set -x
24#PS4='${BASH_SOURCE[0]}:${BASH_LINENO[0]}:'
25#PS4='${BASH_SOURCE[-1]}:${BASH_LINENO[-1]}:'
26