Use thatthis syntax instead:
sh -c "demo.sh ARUN 24" IsIn your case those two arguments where passed to the shsh command, not the demo.sh script. Put them in quotes to pass them trought sh to the script.
But notice,Note the easiest way would be to make the script executable and add a hashbang (#!) line to it. The scripts would then look as follows:
#!/bin/sh name=$1 age=$2 echo $name echo $age Make it executable with:
chmod +x demo.sh And thenThen run it as follows (without the interpreter sh, the interpreter is now gathered fromtfrom the #! line):
./demo.sh ARUN 24