Article 56HYY Check as inside a bash function whether it is being invoked within command subs

Check as inside a bash function whether it is being invoked within command subs

by
BudiKusasi
from LinuxQuestions.org on (#56HYY)
How do we determine or check as inside a bash function whether it is being invoked within command substitution; $() or ``
Code:$ fn m n
$ echo `fn m n`Code:fn(){
# ...
# ?
# How code to detect, determine as being invoked normally or as within $()?
# ?
# ...latest?d=yIl2AUoC8zA latest?i=7ZfoqQJFffI:HjqCmo55lSw:F7zBnMy latest?i=7ZfoqQJFffI:HjqCmo55lSw:V_sGLiP latest?d=qj6IDK7rITs latest?i=7ZfoqQJFffI:HjqCmo55lSw:gIN9vFw7ZfoqQJFffI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments