Just using shell scripting, how can I insert text into the middle of a file name. The file has a predictable pattern, let's say 3 letters and 3 numbers and I want to insert text in the middle of those 2 patterns. Say ABC123 is the file name. As a result, the file name should be ABC.blah.123
|
feedback
|
|
You can use
That means: Take the first 3 characters of the string if they are letters, add the string `.blah.' and add the last 3 characters of the string if they are numbers. If you e.g. want to rename the file you could do:
| |||
|
feedback
|
|
Assuming you have a recent enough
| |||
|
feedback
|