Assign cma list to variable

From cpwiki.net
Revision as of 22:04, 25 February 2013 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Check Point Profressional Services

Assign cma list to an array variable for use in a script

check point command:

mdsstat | grep CMA | sed -e 's/|//g' | awk '{printf $2 " " }'

bash example:

assign to variable

CMA_LIST=$(mdsstat | grep CMA | sed -e 's/|//g' | awk '{printf $2 " " }')

access the first variable via index 0

${CMA_CMA[0]}