I've got directories with multiple files so that they're generally in the format:
identifier1_desiredName1.m identifier1_desiredName2.m identifier2_desiredName1.m identifier2_desiredName2.m identifier3_desiredName1.m identifier3_desiredName2.m
I'm trying to come up with a script that separates the files by the identifier by making a directory using that identifier, and then moves files with the same identifier into that directory. As of right now, I think that I'm on the right track for the directory making: awk _ {print $1} | uniq | mkdir
Syntax probably isn't quite correct, but the general idea is to print out the first column, separated by '_', omitting repeats, and then piping those names into mkdir. But then I'm at a loss for moving the files into the directories. I was thinking about using grep similarly (replacing mkdir above), but I wasn't sure if it would work.