I have two shell script files . One is a general file which install something on system and other is a file which processes some steps of installation.
file1: Main Installation file file2: Installation assistance file
I am calling file2 from file1 using
nohup ./file2.sh $1 </dev/null >../logs/schema.log 2>&1 &
schema_status=$?
echo $schema_status
Now because of nohup schema_status value is coming as 0 always.
How do I return a relevant value from file2 to file1 .
In file2, I have added a return statement:
if (condition)
then
exit 101
else
exit 102
fi