O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

19.10. Executing shell functions

To execute the function, simply type the function name, which is findit, with an argument, which should be a file located somewhere on the system.

						$ findit groups 
/usr/bin/groups 
/usr/local/backups/groups.bak
					

19.10.1. Deleting shell functions

Let’s now make a small change to the function. First delete the function, so it is no longer available to the shell. Do this using the unset command. The format for using the unset command when removing functions is:

unset function_name

							$ unset findit
						

If you type set now, you will find that the function is no longer displayed.

19.10.2. Editing shell functions

Now edit the file functions.main and add a for loop to the function, so the script can read in more than one ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required