Find the answer to your Linux question:
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)? ...
  1. #1
    Linux 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?

  2. #2
    Linux 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?

  3. #3
    Linux 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?

  4. #4
    Linux 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?

  5. #5
    Linux User
    Join Date
    May 2008
    Location
    NYC, moved from KS & MO
    Posts
    251
    thanks blinky. it works like a charm.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...