Let's say I have a following string in a variable called LONG_NAME:
Code:
ata-WDC_WD3200AAJB-00J3A0_WD-WCAV2Y020369 wwn-0x50014ee103971beb
Now I want to simply take out everything in the red color above.
I have been trying the following command but it does not work:
Code:
echo "${LONG_NAME%%_[0-9]*}"
Basically, I am trying to remove anything after the second underscore (including).