Hello,
I'm having a problem with passing the value of a variable into a command line parameter that requires the command to be passed between single quotes.
This works fine...
stccmd -cmd 'status test_component' |egrep -e 'Element |Hostname |State|Last Update Time' > $a_component_status_file #get status
and when I turn verbose on I see this ..WITHOUT the single quotes displayed (like I said this works)
+ egrep -e Element |Hostname |State|Last Update Time
+ stccmd -cmd status test_component
+ 1> /tmp/stc_15619_.tmp
but when I try to pass the component name as a variable
component_name="test_component"
stccmd -cmd \'status $component_name\' |egrep -e 'Element |Hostname |State|Last Update Time' > $a_component_status_file #get status
+ egrep -e Element |Hostname |State|Last Update Time
+ stccmd -cmd 'status test_component'
+ 1> /tmp/stc_15619_.tmp
and when I turn verbose on I see this ..WITH the single quotes displayed (like I said this DOES NOT work)
It looks like it should work, the variable substitution seems to take place but the command doesn't execute. I've tried so many iterations that I'm totally stumped.
Would anyone be so kind as to offer any thoughts?
Thanks,
Randy