The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
thousands separator ynixon Shell Programming and Scripting 11 04-13-2008 11:43 AM
Multiple (thousands) of Cron Instances sysera UNIX for Advanced & Expert Users 10 01-17-2006 09:49 AM
How do I send a file as an attachment (gzip file) on a Unix system lacca UNIX for Dummies Questions & Answers 3 07-03-2002 02:04 PM
gzip in shell script called by cron hbau419 Shell Programming and Scripting 2 02-05-2002 07:03 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 12-28-2007
thepurple thepurple is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 134
script for Gzip thousands of file

Hi experts,

I have thousands of file (data file and Gziped file) in same directory like below--

bash-2.05$ pwd
/home/mmc

bash-2.05$ file PP023149200709270546
TT023149200709270546: gzip compressed data - deflate method

bash-2.05$ file PP027443200711242320
TT027443200711242320: data

i have script which i used before to UNZIP the Gzip files and send it to another directory Among those files Gzip & data files.
Code:
#!/usr/bin/sh
cd /home/mmc/
for i in `ls PP02*`
do
l=`file $i|grep gzip|wc -l`

if [ $l -ne 0 ]; then
gunzip -c $i > /home/mmc/zip/$i
fi
done
Now i need to reverse way. i.e. GZIP the files among those.

Please help me to write the script.
 

Bookmarks

Tags
linux

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 02:17 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