Anything can be piped but it will run in a subshell environment so that commands like trap will not print what you may expect. (POSIX allows but does not require this.) In our sh, you can do
Code:
traps=$(trap)
and it will return the parent shell environment's traps; this commonly works but is not ubiquitous.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.