i need some help to understand the following few lines of a given shell script.
here $_filecount variable hold the number of file to be archived
here i want to know what $TARC means, searched on this command but got no result for TARC and TARU commands. could anybody explain me what these commands are
_archive=${ARCHIVE_PATH}/${_name}_$(hostname)_${_today}.tar
if [ $_filecount -ne 0 ]; then
if ! [ -f ${_archive} ]; then
touch ${ARCHIVE_PATH}/${_today}
$TARC ${_archive} -C ${ARCHIVE_PATH} ${_today}
rm -f ${ARCHIVE_PATH}/${_today}
fi
for i in ${_filelist}; do
$TARU ${_archive} -C ${_path} $i
[ $? -eq 0 ] && rm -f ${_path}/$i
done
fi
when this code is run using cygwin at line $TARC ${_archive} -c ${ARCHIVE_PATH} ${_today} returns following error
tar: invalid option -- 'E'
Try `tar --help' or `tar --usage' for more information.
thanks in advance for any help
$TARCand$TARUare variables (if they aren’t defined in your script somewhere, then they must be environment variables)Try
echo $TARCto see what they are set to.Looks TARC is the tar command to archive and TARU is the tar command to unarchive.
TARC and TARU must be set somewhere or else you would get a different error – the error you are seeing is tar specific.