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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 6 10-25-2008 01:37 PM
How to find whenther given value is in betwwen min and Max in unix shell scripting pinky UNIX for Dummies Questions & Answers 5 07-27-2007 11:52 AM
Scripting to find the size of the folder victorvvk Shell Programming and Scripting 2 03-17-2005 06:14 AM
UNIX find by time scripting budrito UNIX for Advanced & Expert Users 1 10-08-2004 06:19 AM
command find returned bash: /usr/bin/find: Argument list too long yacsil Shell Programming and Scripting 1 12-15-2003 06:38 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-12-2008
buechler66 buechler66 is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 14
Scripting using the FIND command

I'm working on a 'find' command which uses the -exec option to tar a listing of files that it finds. Is there a single option available that would both 1) create the TAR file if it doesn't exist and/or 2) update the TAR file if it already exists?

Currently when I want manually create a TAR file and then add files to it I need to issue two different options to the TAR command. In other words, my command sequence needs to look like:

tar -cvf myTarFile.txt fileA.txt
tar -uvf myTarFile.txt fileB.txt
tar -uvf myTarFile.txt fileC.txt

So in the first iteration I have to include the -c (e.g. create TAR file) option. And in subsequent iterations I have to include the -u (e.g. update TAR file) option.

I want to avoid programatically having to issue a different command for the first iteration. Is this possible?

Any help would be greatly appreciated!!!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:00 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0