Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

return command in Linux with examples

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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
Last Updated : 24 May, 2019
Like Article
Save Article
Similar Reads