Article 4S2T4 [SOLVED] Bash some questions please

[SOLVED] Bash some questions please

by
iammike2
from LinuxQuestions.org on (#4S2T4)
Guys,

sorry to bother you again. I have a couple of Bash questions

Suppose I have 2 scripts like this

script1

Code:#!/bin/bash
echo "In script 1"
source script2.sh
echo "back in script 1"
exit 0
script2

Code:#!/bin/bash
echo "in script 2"
exit 0Question 1:
Is using "source" the best way to call another script or ???
I would prefer to have the scripts in the same Dir as the "Main" script, but if that is not a good idea, please let me know

Question 2:

Must I use exit 0 (or any other errorlevel) or use return to leave SCRIPT2 or is that not necessary ?

Question 3:

And must I use exit "number" at the end of the main script or is that also not necessary (not doing anything with the output (yet ;) )

Thx again guys, really appreciated.latest?d=yIl2AUoC8zA latest?i=FKvhWJv8aK8:0vx3hRIS0cA:F7zBnMy latest?i=FKvhWJv8aK8:0vx3hRIS0cA:V_sGLiP latest?d=qj6IDK7rITs latest?i=FKvhWJv8aK8:0vx3hRIS0cA:gIN9vFwFKvhWJv8aK8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments