I am trying to shorten the string in linux and retaining the extension in linux using sed but my command is erroring out with "sed: -e expression #1, char 21: unknown option to `s'"
The string I take is "15400_AP705_OUT_03112016_0513_001.DAT" and the output I am looking for is 15400_AP705.DAT
The command I am using is
echo 15400_AP705_OUT_03112016_0513_001.DAT | sed -r "s//(.{11}).*(\..*)$/$1$2/"
Regards, Srinath