Tente isto:
$ awk -F'[()]' 'NF>2{print $2;next}1' file
ABC_DFG_FRE
DFR_GHY_JUY
BGR_KIU_PLO
VFR_KJU_MKJ
Minha entrada é:
ABC_DFG_FRE
s(DFR_GHY_JUY)
BGR_KIU_PLO
s(VFR_KJU_MKJ)
saída deve ser:
ABC_DFG_FRE
DFR_GHY_JUY
BGR_KIU_PLO
VFR_KJU_MKJ
Tente isto:
$ awk -F'[()]' 'NF>2{print $2;next}1' file
ABC_DFG_FRE
DFR_GHY_JUY
BGR_KIU_PLO
VFR_KJU_MKJ
Ou com sed:
sed 's/.*(//; s/).*//' file
ou o mais rigoroso:
sed 's/.*(\(.*\)).*//' file
Tags shell-script