how do i assign the output of command to another variable in shell, here what i tried.
summary = `grep -A 4 '#HM based Segregation FEP (WNS)(TNS)' some_file | awk '{print $2, $3}' | sed 's/,=,//g' | tr '\n' ',' | sed 's/based Segregation,//g' | sed 's/(\|\ (/\//g' | sed 's/)//g'`
summary1 = $(grep -A 4 '#HM based Segregation FEP (WNS)(TNS)' some_file | awk '{print $2, $3}' | sed 's/,=,//g' | tr '\n' ',' | sed 's/based Segregation,//g' | sed 's/(\|\ (/\//g' | sed 's/)//g')
echo "$summary"
echo "$summary1"
basically, I am grepping from some patterns and removing unwanted data. and the output is
summary: Command not found.
Illegal variable name.
what am I doing wrong?