I have 3 files as listed below and highlighted in bold the portions of the filenames I need to extract:
TOS_TABIN218_20090323.200903231830
TOS_TABIN219_1_20090323.200903231830
TOS_TABIN219_2_20090323.200903231830
I tried
source_tabin_name=`echo $fname | sed 's/_[0-9].*[0-9]//'`
but I only get
TOS_TABIN218
TOS_TABIN219
TOS_TABIN219
The TOS TABIN218 is correct but both Tabin219 are missing the _1 and _2 respectively.
.. any how to get the extra _1 and _2