I am very new to BASH and I am having difficulties moving a long list of image files into similarly named directories. I've been trying to come with a script all night and no luck. Here is what my list of files looks like:
DSC_0059_01.jpg
DSC_0059_02.jpg
DSC_0059_03.jpg
DSC_0059_04.jpg
DSC_0059_.....jpg
DSC_0060_01.jpg
DSC_0060_02.jpg
DSC_0060_03.jpg
DSC_0060_.....jpg
Here is what the directories look like:
DSC_0059
DSC_0060
DSC_.......
DSC_0111
How do I move the .jpegs into their corresponding directories so that, for instance, directory DSC_0059 contains: DSC_0059_01.jpg, DSC_0059_02.jpg, ...etc.?
Thank you