I have a bash script that takes a name and a command as arguments. Its pretty simple like this,
#myscript
echo $1
$2
And I run this like this
bash myscripts myjob ls
and it will echo the 'myjob' and run the ls command. But when the command is multi-word, I have to provide it with an inverted commas, like this
bash myscripts myjob "ls -l"
Now my question is, is there a way to write the shell script so that, I don't have to provide the inverted commas? Like, take everything as my command instead of the first argument? Is it possible to do with bash?