Deeper into Function Complexities with Shell Scripting – Part VII

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Anoop C S

I am basically a FOSS enthusiast interested in working under GNU/Linux and system administration. Looking forward to become a part of an open source initiative. Currently pursue Computer Science & Engineering.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Linux BASH Programming Cookbook
Getting Started with Ubuntu 16.04
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

2 Responses

  1. Anoop C S says:

    Try to understand the difference based on the output of following shell script:


    function return_func () {
    echo “I’m returning, but not exiting . . .”
    return 1
    echo “This will not be displayed :-)”

    function exit_func () {
    echo “I’m exiting . . .”
    exit 0
    echo “This will not be displayed :-)”

    echo “Before returning.”
    if [ $? -eq 1 ]; then
    echo “Before exiting.”
    echo “And you will not see this on execution”
    exit 2

    Check the output status using $? immediately after the execution of the above script. I hope that’s clear.

  2. Aaron Kili K says:

    what is the difference between a return statement and an exit statement in shell functions.

    Could you explain with some brief examples.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?