Regarding Shell variable
- by arav
I need to call another shell script testarg.sh within my main script. This script testarg.sh has arguments ARG1 ,ARG2, ARG3. I need to call up the below way
./testarg.sh -ARG1 -ARG2 -ARG3
ARG1 and ARG3 argument Variables are mandatory ones. If its not passed to the main script then i quit. ARG2 is an optional one. If the ARG2 variable is not set with value or it's not defined then i need not pass it from main script.So i need to call up the below way
./testarg.sh -ARG1 -ARG3
If the value exist for the ARG2 Varibale then i need to call the below way
./testarg.sh -ARG1 -ARG2 -ARG3
Do i need to have a if else statement for checking the ARG2 variable is empty or null. Is there any other way to do it.