Bash Functions can't return values like other standard programming languages. Bash functions support return statement but it uses a different syntax to read the return value. You can get the value from bash functions in different ways. In this tutorial, you will learn how you can pass string data from bash function to the caller by using different types of bash syntaxes.
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.