I\'m calling a shell script from another shell script and the called script requires some input (command line) parameters.
I\'m have below mentioned code, but thats not work
By sourcing the second script with . /home/admin/script2.sh
, you're effectively including it in the first script, so you get the command line arguments to the original script in $@
. If you really want to call the other script with arguments, then do
/home/admin/script2.sh "$ARG1" "$ARG2" "$ARG3"
(make sure it's executable).