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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.