The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Copy Compress as one command findprakash UNIX for Dummies Questions & Answers 9 11-28-2007 08:44 PM
lp command with compress mode zita Linux 3 10-10-2005 02:25 AM
Help on compress command rahulrathod SCO 1 09-28-2004 01:11 PM
tar command with compress option... tomapam UNIX for Dummies Questions & Answers 3 10-11-2002 09:56 AM
cpio command with compress sureshy UNIX for Dummies Questions & Answers 1 09-10-2001 05:06 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 08-17-2007
Registered User
 

Join Date: May 2007
Posts: 17
Compress command

PHP Code:
compress /var/opt/l2/amer/art2/USFINUM0[1-9]200[6-9]_[1-3].CSV
compress 
/var/opt/l2/amer/art2/USFINUM[10-12]200[6-9]_[1-3].CSV

compress 
/var/opt/l2/amer/art2/USFINUM0[1-9]20[10-99]_[1-3].CSV
compress 
/var/opt/l2/amer/art2/USFINUM[10-12]20[10-99]_[1-3].CSV 
Is there a way to shorten this or write it in a script. The file to be compressed will be USFINUM but as you can see the month and the year will change and there can be three files (1-3).

Thanks a lot.

Regards,
Indira
Reply With Quote
Forum Sponsor
  #2  
Old 08-17-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
How about using !

Code:
compress /var/opt/l2/amer/art2/USFINUM*
Do you want to compress all the USFINUM values under compressed directory ?
Reply With Quote
  #3  
Old 08-20-2007
Registered User
 

Join Date: May 2007
Posts: 17
Thanks a lot. I tried using the wildcard and that did not work. Unix cannot find the file in that case.

Regards,
Indrani
Reply With Quote
  #4  
Old 08-20-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Quote:
Originally Posted by indira View Post
Thanks a lot. I tried using the wildcard and that did not work. Unix cannot find the file in that case.

Regards,
Indrani
cannot find the file !! ??!!!

are you able to view the files when displayed with ls /var/opt/l2/amer/art2/USFINUM*
Reply With Quote
  #5  
Old 08-20-2007
Registered User
 

Join Date: May 2007
Posts: 17
I am sorry, did not explain properly. When I run this command with the wild card * it does not pick up the files to compress - probably there are 2-3 files with that name but with different month, year and extensions. Though the file name starts with USFINUM. So had to make it so long.

Thanks for the help.

Regards,
Indira
Reply With Quote
  #6  
Old 08-20-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Quote:
Originally Posted by indira View Post
I am sorry, did not explain properly. When I run this command with the wild card * it does not pick up the files to compress - probably there are 2-3 files with that name but with different month, year and extensions. Though the file name starts with USFINUM. So had to make it so long.

Thanks for the help.

Regards,
Indira
what difference it is going to make if they have different month / year / day ?
everything would be selected for compression by the meta character ' * '

name20070809.txt
name20061223.txt
name20070230.txt

all the files should be selected the command name*
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:34 PM.


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