0

I have 2 scripts: S1.sh and S2.sh.

S1.sh can run independently, and can receive positional value from "$1" as an optional parameter. This "$1" value is dynamic, and may be any number between 0 and 9.

VAL=$1

S2.sh is designed for remote triggering of S1.sh, and it uses its own "$1" (string value) for a different purposes.

I'm looking for a way to assign "$2" provided to S2.sh to $VAL of S1.sh.

1 Answer 1

3

When S2.sh calls S1.sh, use

S1.sh "$2"

The value of S2's second parameter is passed as the first argument to S1.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.