I have a shell script called sample1.sh where I have 2 variables. Now I have another shell script called sample2.sh. I want the variables in sample1.sh to be available to sample2.sh.
For example. In sample1.sh I am finding the sum of 2 numbers namely a and b. Now I want to access these variables in sample2.sh. Is this possible? How can I do this?
If you have only variables in sample1.sh, then you can use above code, else keep all the variables in one file and replace sample1.sh by that file name in above code.