В моем коде я создаю 2 папки.Одна из них - папка для хранения архивов, другая - папка внутри архива, в которую будут помещены tar, сжатый файл и Jar-файл.
Почему, когда он попадает в команду jar, он говорит .tar.Z неттакой файл или каталог ??
#!/bin/bash
echo "++++++++++++++++++++++++++"
#The script should prompt the user for the name of a folder to archive.
echo "Please enter the name of a folder to archive"
read file1
echo "++++++++++++++++++++++++++"
#The script should prompt the user for the name of a folder to store the archives in.
echo "Please enter a foldername to store archives in"
read file2
echo "++++++++++++++++++++++++++"
#The script should create the folder input in step 2.
mkdir $file2
cd $file2
mkdir $file1
echo "Created Files"
echo "++++++++++++++++++++++++++"
#The script should run the command to TAR all of the files in the folder specified in step 1 to a tar archive called [folder name].tar in the archive folder specified in step 2.
tar cf $file1.tar $file1
echo "++++++++++++++++++++++++++"
#The script should compress the TAR file you created in step 4 to a [folder name].tar.Z in the archive folder specified in step 2.
compress -v $file1.tar
echo "++++++++++++++++++++++++++"
#The script should run the command to JAR all of the files in the folder specified in step 1 to a jar archive called [folder name].jar in the archive folder specified in step 2.
jar cf $ffile1.jar $ffile1.tar.Z
echo "++++++++++++++++++++++++++"