Skip to main content

Shell Functions

  • Chapter
Pro Bash Programming
  • 6937 Accesses

Abstract

A shell function is a compound command that has been given a name. It stores a series of commands for later execution. The name becomes a command in its own right and can be used in the same way as any other command. Its arguments are available in the positional parameters, just as in any other script. Like other commands, it sets a return code.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 69.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Chris F. A. Johnson and Jayant Varma

About this chapter

Cite this chapter

Johnson, C.F.A., Varma, J. (2015). Shell Functions. In: Pro Bash Programming. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0121-3_6

Download citation

Publish with us

Policies and ethics