. two.sh
or equivalently
source two.sh
performs "sourcing" of the 2nd script. This is similar to including and executing the code of two.sh as if it was inside one.sh (ie if two.sh defines functions, you can source two.sh in one.sh and then use those functions in one.sh).
This is not the same as just calling two.sh from one.sh (like if you were calling an executable or any
other standard command like "ls", etc).
To do that, just call two.sh with it's parameter:
/path/to/two.sh param1 param2 ...
Make sure that two.sh
1. is executable
2. has an appropriate path (unless it's in one of the directories of $PATH)
Catching two.sh's output can be done via backticks or similar syntax. Check the man pages of your shell for syntax details.
|