All, I've searched and haven't found a solution for my particular issue.
I have a file with lines of data that contain varying amounts of underscores imbedded. But all the strings have a final underscore and an interface name:
dmk_hcn_dalian2.XXXX.XXX.XX.COM_Se0/0/0
cn_beijing_terminalserver.XXX.XX.COM_Se0
aurtrpara_1.XXXXX.XXX.XX.COM_Tu108
aurtrpara_2.XXXX.XXX.XX.COM_Tu202
dmk_hcn_dalian1.XXX.XX.COM_Se0/0/0
buranda_2.XXX.XX.COM_Tu215
I need to cut each line at the last underscore, keeping the interface name as one variable, and the Fully Qualified Domain name as another. The problem is that the domain has varying amount of periods as well.
Does anyone have a recommendation to get the output I need with awk/cut/ or sed?
appreciate any suggestions!