I have a variable COMMAND that contains
COMMAND="grep \"TEXT\" myfile"
when i echo $COMMAND I get
grep "DOG CAT" myfile
when i execute
$COMMAND
it does not work properly
Does anyone know why this is not working
This is a discussion on simple shell within the Linux Programming forums, part of the Platform Specific Boards category; I have a variable COMMAND that contains COMMAND="grep \"TEXT\" myfile" when i echo $COMMAND I get grep "DOG CAT" myfile ...
I have a variable COMMAND that contains
COMMAND="grep \"TEXT\" myfile"
when i echo $COMMAND I get
grep "DOG CAT" myfile
when i execute
$COMMAND
it does not work properly
Does anyone know why this is not working
Try
eval $COMMAND
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]