The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Creating menus in script file sinjin UNIX for Dummies Questions & Answers 6 12-10-2007 09:00 PM
Creating a menu within a script file sinjin Shell Programming and Scripting 8 12-09-2007 10:18 PM
Help with a shell script for creating a log file heprox Shell Programming and Scripting 2 11-13-2006 11:00 PM
Help ! Script creating unwanted file boppr6470 Shell Programming and Scripting 2 10-05-2006 03:27 PM
Creating a file inside a script sendhilmani Shell Programming and Scripting 11 03-21-2006 05:24 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-30-2005
Registered User
 

Join Date: Nov 2005
Posts: 8
Error while creating .tar file using script

Hi,

I am getting following error while running script:

tar: can't change directories to /home/xyz/script: No such file or directory
tar: compress: No such file or directory
tar: getts.tar same as archive file

Following is my script:

#!/bin/bash

echo "You want:"
echo "1. zip files."
echo "2. remove files."
echo -n "Enter your option:"
read opt

echo -n "Enter full File path:"
read PATH
echo -n "Enter File name:"
read FILE

if [ $opt -eq 1 ]
then
#zip files

/usr/bin/tar -cvf $FILE.tar $PATH compress $FILE.tar

fi


Can some one give some solution.

thanks
Reply With Quote
Forum Sponsor
  #2  
Old 12-30-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
read PATH

Gack!! Don't do that! PATH is a special variable that tells the shell where to find commands. Use some other name.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0