I have following files with names like:
Selection_Test_from_120118_1140118.txt
Selection_Test_from_monthly_120118_1140118.txt
how we can rename both files by removing string from file:
string1 --> Selection_Test.txt (remove "_from_120118_1140118")
string2 --> Selection_Test.txt (remove "_from_monthly_120118_1140118")
I want to use parameter expansion method instead of traditional cut command here
_from*
:"${string2%%_from*}"
– steeldriver Jan 19 '18 at 01:06