The above script should executed from a shell script named test.sh. I have the below code to execute it, but it fails to pass the positional parameters,
If you say "bash script", then why are you trying to use /bin/sh at the top of the script? For some reason, "sh" does not seem to work correctly with sourcing the file. "bash" works either way, sourcing or calling.