This is a script that I'm using:
#!/bin/bash
VAR1="$1"
MOREF='sudo run command against $VAR1 | grep name | cut -c7-'
echo $MOREF
When I execute it and pass the required arguments, there is no output coming out. But if I execute it within the $MOREF variable, I do get the output. I just want to get the results of the command, save it to a variable and then print it out on the screen.