bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about exit command


From: ali hagigat
Subject: question about exit command
Date: Wed, 19 Jan 2011 14:12:21 +0330

I have two script files and I execute them as follows:
-------------------------------------
#script1
echo ppp
exit 0
echo qqq
/root> ./script1
ppp
-------------------------------------
#script2
if (exit 0) then
    echo ppp
fi
/root> ./script2
ppp
-------------------------------------
In script1, when exit executes, it returns and immediately
shell(/bin/bash) returns too. Why in the second script shell completes
if command and does not return immediately? In script 2, what will be
the return value of shell? The option of exit or the return value of
echo?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]