I am a new user to unix that is trying to do a simple script in bash that will unzip several files in the location that I list. I can't figure out why it keeps crashing. I'm inserting the script below. I hope to later move the old .tar.7z zipped files into another directory (hence my creating the new directory in the script below), but I am just trying to get the main part working first.
#!~/bash
# My program to try to unzip several files with ending of tar.7z
# I have inserted the ability to enter the directory where you want this to be done
echo "What file location is required for unzipping?"
read dirloc
cd $dirloc
mkdir oldzippedfiles
for directory in $dirloc
do
if
[ $directory=*.tar.7z ]
then
cat $directory | 7za x -an -txz -si -so | tar -xf -
fi
done
echo "unzipping of file is complete"
exit 0
cat
? Could you give an example of a directory you want to run this script on?