INFILE="ABC_BMWPPI_20120909_00073.DAT.ASDFGHJK" -> 44 character long
mv INFILE GEPB_${INFILE:${#INFILE}-27:15}dat
result is GEPB_20120909_00073.DAT.
I am confused in how we get it.
If I evaluate
1- GEPB_${INFILE:${#INFILE}-27:15}dat
2- GEPB_${INFILE:${44}-27:15}dat
3- GEPB_${INFILE:14:15}dat
4- GEPB_20120909_00073.dat
Can anybody explain how ${44} got evaluated here?
generally $ comes with variable name, how it is working with number here.
(NB: it appears formatting may have eaten some of your characters; from my count "ABC_BMWPPI_20120909_00073.DAT.ASDFGHJK" is only 38 chars long, so it's hard to reconcile this with the exact output you're getting since the numbers are off - the basic idea/concept is the same)