I have a bunch of files which all have a first line being a date. All of them start with the same first 2 letters being "ff". I need to create a script which would use that first line in all files and sort them in directories creating these directories as well.
For example 1 file contains that:
I need to extract the full date moving all files into directories for year then sub directories for month and another sub for day. So far I have this script which only moves files by year. I was told that I could use -p function, but really I have been using UNIX for 3 days so got confused now.