== script0.sh ==
(some code NOT source that calls script1.sh so it can see script1.sh variables)
== script1.sh ==
#!/bin/bash
_name="script1.sh via source"
source script2.sh $*
echo The user is $_user and the password is $_password
== script2.sh ==
#!/bin/bash
echo script2.sh was called from $_name
echo The parameters are $1 $2 $3 $4 $5 $6 $7 $8 $9
read -p "User name?" _user
read -p "Password?" _password
== Example of script1.sh calling script2.sh ==
$ ./script1.sh All your base are belong to us
script2.sh was called from script1.sh via source
The parameters are All your base are belong to us
User name?WHAT
Password?HAPPEN
The user is WHAT and the password is HAPPEN
|