I am new to the linux and shell scripting. I have a script, which has some read commands in it. So, something like
#script1.sh
echo "something here"
....
read var1
read var2
...
Now, i want to write another script that calls this script and can pass the values to this script. So, i'm hoping for something like,
./script2.sh hello world
And, that would run script2 and store "hello" in var1 and "world" in var2. What should this script2 contain and how can i pass these arguments to script1?
I have searched for this a lot but i didn't find anyone explaining this.
Best Answer
Calling script2.sh from script1.sh
In script2.sh
Ouput will be
hello world