Removing functions

If we no longer need the function in the shell, then we use the following command:

    $ unset -f hello
    $ declare -f hello          # Check the function in shell environment.
  

Nothing will be displayed on the screen, as the hello function is removed from the shell environment with the unset command.

Get Learning Linux Shell Scripting - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.