JtheRipper
IS-IT--Management
Hi there,
I have a directory of files with all the same length and format i.e. 040601LV*, where * can be anything from A-Z, but single characters only, so no AA, AB, etc and the letter closest to A will show me the oldest file.
I want to compare the last character of each file, I can already loop through all files and read the last character in a variable with the help of the cut command. Now I want to compare the last letter of each file, start with the oldest file (letter A or closest to A is oldest), do something, go to next file and exit when done.
How do I compare the letters to one another and figure out which one is "older" than the other? I have thought of creating another text file with letters A-Z and giving them numerical values, but any other ideas will be appreciated!
Thanks,
J.
I have a directory of files with all the same length and format i.e. 040601LV*, where * can be anything from A-Z, but single characters only, so no AA, AB, etc and the letter closest to A will show me the oldest file.
I want to compare the last character of each file, I can already loop through all files and read the last character in a variable with the help of the cut command. Now I want to compare the last letter of each file, start with the oldest file (letter A or closest to A is oldest), do something, go to next file and exit when done.
How do I compare the letters to one another and figure out which one is "older" than the other? I have thought of creating another text file with letters A-Z and giving them numerical values, but any other ideas will be appreciated!
Thanks,
J.