Year Month day from file name in shell script
- by user3319390
I hava file names like below
adn_DF9D_20140515_0001.log
adn_DF9D_20140515_0002.log
adn_DF9D_20140515_0003.log
adn_DF9D_20140515_0004.log
adn_DF9D_20140515_0005.log
adn_DF9D_20140515_0006.log
adn_DF9D_20140515_0007.log
i want get the year, Month, day from file name and create directories
Ex: [[ ! -d "$BASE_DIR/$year/$month/$day" ]] && mkdir -p "$BASE_DIR/$year/$month/$day";
How to achieve this and share the ideas/ script appreciate to you