I want to match just the folder name that a file is in,
I want to just match what I put in bold.
So far I have this:
Without using a regular expression:
FILE_NAME="pic/2009/cat01.jpg" basename $(dirname $FILE_NAME)
dirname gets the directory part of the path,
basename prints the last part.