Script that takes strings as input

Hello all!

I need to take a series of inputs passed to one shell script and pass them to a second shell script.

For example, the first shell script, script_one.sh, has the following inputs:

./script_one -u username -p password -option1 string1 -option2 -string2 ....

Inside of script_one.sh I want to pass script_two.sh the same inputs as shown below...

./script_two -u username -p password -option1 string1 -option2 -string2 ....

However, I do not know all of the inputs nor what order they are in. I simply want to take what is passed to script_one and pass it to script_two possibly in the form of a string.

Any ideas?

Thanks!

If you meant what I'm thinking of
Simply you can store strings in variables and pass them to any number of scripts using the advantage of the shell replacement

$> string1=sometxtvalue 
$> string2=sometxtvalue
$> ./script_one -u username -p password -option1 $string1 -option2 -`echo $string2` ....
$> ./script_two -u username -p password -option1 $string1 -option2 -`echo $string2` ....

post here if this doesn't suits your needs

Thanks for trying to help! But the problem is that I don't know what variables are being passed. I just need to take all inputs passed to script_one and pass them to script_two. It needs to be an exact copy of the string and I do not know the number of inputs nor the order.

you can call 2nd script as below from script_one
./script_two $@

doest it help ??

1 Like

Perfect! Thanks Amaravathi!