Skip to content
Related Articles

Related Articles

Improve Article
return command in Linux with examples
  • Difficulty Level : Expert
  • Last Updated : 24 May, 2019

return command is used to exit from a shell function. It takes a parameter [N], if N is mentioned then it returns [N] and if N is not mentioned then it returns the status of the last command executed within the function or script. N can only be a numeric value.

Syntax:

return [N]

Example:

Note: echo $? is used to display the last return status.

Option:

  • return –help : It displays help information.

My Personal Notes arrow_drop_up
Recommended Articles
Page :