I need assign the Output of comm Command to variable. I use comm to campare two list of values.
These two lists are defined as:
DATA_REF_DATA_OPIT_SIP='PCSCF4A
PCSCF4B
PCSCF5A
PCSCF5B'
DataExist='PCSCF4B
PCSCF5A
PCSCF5B'
And when i do
comm -23 <(sort <<<"$DATA_REF_DATA_OPIT_SIP") <(sort <<<"$DataExist")
Output :
PCSCF4A
I want to assign the output of comm to a Variable. So i did :
res=$(comm -23 <(sort <<<"$DATA_REF_DATA_OPIT_SIP") <(sort <<<"$DataExist"));
echo $res
I get empty output.
instead of :
echo $res
PCSCF4A
Please Help. Thanks you.