Consider I have script like given below.
demo.sh:
name=$1 age=$2 echo $name echo $age when I execute the script like
sh demo.sh ARUN 24 Output is:
ARUN 24 But, When I execute the script like
sh -c demo.sh ARUN 24 Output is nothing.
I know if i use sh -c arguments will be assigned starting from $0. But only file name is getting assigned to $0. How can i assign more than one parameters when is use sh -c? Please explain me how it works.