I have file names (log files) with a time stamp in their name.
Here is an example:
I'd like to use sed to extract YYYY, MM, and DD portion.
So far I was only able to get rid of the .gz part using something like this:
filename=`echo log.2002-01-07-235959.gz | sed 's/\.gz//'`
I checked the man page, but couldn't figure it out from there.
Can anyone help?