I've got a series of files in the following format:
YYYYMMDDHHmmXXXXXX.m4a in a directory
I'd like to write a script that will allow me to store each filename as a variable, let's call it MyFile, then store "YYYMMDDHHmm" (first 12 charachters of each file) as a variable, let's call it TimeStamp and use it to update the Date Created data for each file in the loop. The command should look something like:
touch -t TimeStamp Myfile.m4a
I'm new to writing scripts and have written the following which is returning an unexpected end at line 17
#!/usr/bin/env bash
for f in /Users/username/music/M4Atest/*.m4a;
do filename=${f%%.*};
echo ${filename};
for ${filename};
do timestamp="${filename:0:12}";
echo ${timestamp};
done;
Thanks for any help