I think I should explain the task of the script again:
I'm using a lot of MD5 checksum files (md5sums), which hold MD5/file name pairs, for comparison and also for my CD/DVD data backups to verify if they got burned correctly. I also update md5sums files from time to time (see my script addmd5). For several different reasons I like to have these files (i.e. the content of the files) sorted alphabetically after the filename, not the MD5 sum. Therefore a simple sort doesn't work.
The sortmd5 script takes a md5sums file, splits MD5 sums and file names and sorts them after the file names, then joins the lines again and outputs the result.
The default is to work in-place (similar to the -i switch), i.e. write the result back to the original file, if no output file name is given. If the input file had unreadable lines a backup is created before it is overwritten.
Usage example:
The following input MD5 file
is rewritten to:443..29D test.avi 563..D93 xyz AB2..FFE a.file
AB2..FFE a.file 443..29D test.avi 563..D93 xyz
In reply to Re^2: sortmd5 script
by mscharrer
in thread sortmd5 script
by mscharrer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |