Results 1 to 2 of 2
Hey guys,
Im new enough the korn scripting so don't really know where to start on this one!
Basically I have a list of files in one directory
eg.
2011-05-12-1700_ABCD.xml
...
- 05-12-2011 #1Just Joined!
- Join Date
- May 2011
- Posts
- 1
Korn script to change part of file name
Hey guys,
Im new enough the korn scripting so don't really know where to start on this one!
Basically I have a list of files in one directory
eg.
2011-05-12-1700_ABCD.xml
2011-05-12-1700_EFGH.xml
2011-05-12-1700_IJKL.xml
2011-05-12-1700_MNOP.xml
2011-05-12-1700_QRST.xml
What I want to do is write a script that will change the first part of the filename and leave the second part alone.
So Basically i want to change "2011-05-12-1700" to "2011-05-13-0900"
So after the script is run I will have
2011-05-13-0900_ABCD.xml
2011-05-13-0900_EFGH.xml
2011-05-13-0900_IJKL.xml
2011-05-13-0900_MNOP.xml
2011-05-13-0900_QRST.xml
Any ideas???
- 05-12-2011 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
That's what the rename command is for. IE:
Code:rename 2011-05-13-1700 2011-05-13-0900 2011-05-13-1700*.xml
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote