|
| From: | Steve Amerige |
| Subject: | Re: [Help-bash] Bash Trap: How to Get Line Number of a Subprocess with N |
| Date: | Fri, 30 Dec 2016 07:58:36 -0500 |
| User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
I also tested:
1 #!/bin/bash
2 shopt -s extdebug
3 main() {
4 trap 'echo $LINENO' ERR
5 $(exit 17)
6 }
7 main
The above also has the desired output of 5.
So, either form of command substitution gives the desired result, but
using a subshell as in:
(exit 17)
does not give the desired LINENO result.
| [Prev in Thread] | Current Thread | [Next in Thread] |