I have a variable with value like:
@capability_ids type="list">[LOADBALANCER]</capability_ids>@
And need to extract from this string type of equipment ( LOADBALANCER ).
I've tried to use cut, but don't know how write cut command with different delimiters.
DeviceType=$( echo $DeviceTypeDirty | cut -d'[' -f1)
Can enywone help me with right solution on bash?
use
awk
with regular expression:awk -F '[\\[\\]]' '{print $2}'