Can I join two commands defined as String and run as one. E.g.
var=$(ls -alt)
var2="| grep usersfile"
'{$var & $var2;}'
Can I join two commands defined as String and run as one. E.g.
var=$(ls -alt)
var2="| grep usersfile"
'{$var & $var2;}'
you can use the
&
operator to combine two commands.example:
But in case you want to give the first commands output as input to the second command, you can always trust the pipeline
|
example: