Results 1 to 5 of 5
I encounter this question from time to time: is there a (better) way to view the body of a function in ~/.bashrc besides using editor or cat (or grep -A)? ...
- 10-25-2009 #1Linux User
- Join Date
- May 2008
- Location
- NYC, moved from KS & MO
- Posts
- 251
quick way to view functions defined in ~/.bashrc
I encounter this question from time to time: is there a (better) way to view the body of a function in ~/.bashrc besides using editor or cat (or grep -A)? The idea is this, when we need to see what alias has been defined, we use command alias, what about functions?
- 10-25-2009 #2Linux Newbie
- Join Date
- Sep 2004
- Location
- UK
- Posts
- 160
try set or typeset -f
In a world without walls and fences, who needs Windows and Gates?
- 10-25-2009 #3Linux User
- Join Date
- May 2008
- Location
- NYC, moved from KS & MO
- Posts
- 251
Thanks blinky,
set or typeset -f works great. But what if I just want to see the body of a specific function instead of all functions?
- 10-26-2009 #4Linux Newbie
- Join Date
- Sep 2004
- Location
- UK
- Posts
- 160
try typeset -f <function_name>
In a world without walls and fences, who needs Windows and Gates?
- 10-27-2009 #5Linux User
- Join Date
- May 2008
- Location
- NYC, moved from KS & MO
- Posts
- 251
thanks blinky. it works like a charm.


Reply With Quote