I have one script that takes the name of argument and its value, like this:
script1.sh --netId netIdValue
However, I'd like to call this command multiple times in another script, for the different values of netId argument. So, in script2.sh I want to read the values of netIdValue from the .txt file and then to call the same command, like this:
while IFS= read -r line; do
netIdValue=$line
./script1.sh --netId $netIdValue
done < netNames.txt
But, this fails, and it seem the problem is that it does not take --netId properly. How can I pass the argument name and its value in script2.sh?