I have a file that has been created by exiftools and then parsed and cut to fit my needs and thrown into a file that looks like this:
ln -s /source/directory/2009/10/img1.jpg /destination/directory/gallery/2009/10/img1.jpg
ln -s /source/directory/2009/10/img2.jpg /destination/directory/gallery/2009/10/img2.jpg
ln -s /source/directory/2009/10/img3.jpg /destination/directory/gallery/2009/10/img3.jpg
ln -s /source/directory/2009/10/img4.jpg /destination/directory/gallery/2009/10/img4.jpg
ln -s /source/directory/2009/11/img1.jpg /destination/directory/gallery/2009/11/img1.jpg
ln -s /source/directory/2009/11/img2.jpg /destination/directory/gallery/2009/11/img2.jpg
ln -s /source/directory/2009/11/img3.jpg /destination/directory/gallery/2009/11/img3.jpg
ln -s /source/directory/2009/11/img4.jpg /destination/directory/gallery/2009/11/img4.jpg
I then make the file executable and then execute it. Trouble is, the destination directories don't actually exist, so naturally, the "ln -s" fails.
Is there a way to create the destination directories dynamically based on what is specified in the file above?
I would sure appreciate any insight. Thanks in advance.