Hello, I have one "tar.Z" file. Objective is to unzip it by shell script and check the date. File archive: filename_20140103_1540.tar.Z
#!/bin/bash
cd $REP_DATAS/path
u=$(date +%u)
if [ ${u} -eq 1 ] ; then
dateQ=`date --date='-3 day' +'%Y%m%d_%H%m'`
else
dateQ=`date --date='-1 day' +'%Y%m%d_%H%m'`
fi
tar xvf filename_"dateQ".tar.Z
THANKS IN ADVANCED.