I'm new to shell script, currently I have a shell script named deploy.sh
, it can take some options like -n namespaceName -a appName and so, like the following.
./deploy.sh -n namespaceA -a appB
but when I execute it like the following via SSH, it doesn't work,
ssh root@$remoteHost 'bash -s' < deploy.sh -n namespaceA -a appB
And when I modify the script to accept paramters directly instead of options(like the above), it works fine.
ssh root@$remoteHost 'bash -s' < deploy.sh namespaceA appB
Is there any way to pass options to it? Anyone can shed some light? TIA.