As in the title, I've got a simple script I made to change the date modified on my movies to a more correct date, so I can order the directory by date modified to find things better. Just wondering what other improvements I should be making. I'm thinking it needs more error handling, particularly on the retrieval of the date in case that fails etc. Code: #!/usr/local/bin/bash # Date Modified changer # by me # 28.03.2020 # # This program takes the premiered date from an XML file (eg a info file generated by KODI) # and uses it for the date modified for the intended file. The use was brought about by a server # upgrade data transfer performed incorrectly (lost original timestamp information) # if [ $# != 2 ] then echo "Error: please run program with two filenames." echo "eg. " $0 "filename1.txt filename2.mkv" exit 0 fi xmldate=$( xmllint --xpath "string(//premiered)" "$1")T00:00:00 echo $xmldate touch -d $xmldate "$2"