Please, don't be too much strict to my question and even it's a structure (maybe I have structured the sentence in a wrong way), as I am learning bash scripting. So the goal is to pass variable, which on his turn is another command (eg. ls -l | wc -l
), to script execution.
To pretend this is my command from my terminal
./variables.sh (ls -l | wc -l)
As you may guess, this doesn't work and throws an error
bash: syntax error near unexpected token `ls'
So the question is - how to do it right?