![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Shell scripting | sreejith | SUN Solaris | 2 | 10-08-2006 10:38 AM |
| difference between AIX shell scripting and Unix shell scripting. | haroonec | Shell Programming and Scripting | 2 | 04-12-2006 09:12 AM |
| Help on SED AWK in shell scripting | kaushys | Shell Programming and Scripting | 3 | 03-09-2006 02:40 PM |
| Shell scripting | sendhil | Shell Programming and Scripting | 1 | 02-14-2006 12:16 PM |
| Shell scripting | dipanrc | Shell Programming and Scripting | 4 | 10-27-2005 04:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
You are repeating yourself. Try to clarify what should happen.
The way I understand your question is: 1. Your file contains many lines, some of which are names of .gz files. Find those lines. 2. For each found line, unzip the file it names. 3. (Not clear what you mean; unzipping a file will replace it with an uncompressed version already; is that not what you want?) |
|
||||
|
hi,
you are absolutely right ....bt i wanna it in somethng different way.. let me clear you the question question with exzmple: lets say i have a file named "sample". it contains somany lines of data as /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample.gz /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample1.gz /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample2.gz ... ... i will take the file "sample" as input.after unzipping the output shud be output: ===== /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample1 /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample2 ... ... quick response is appreciable. |
|
||||
|
my requirement is:
input (lines in the file) /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample.gz /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample1.gz /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample2.gz ... ... output: ====== /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample1 /common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample2 ... ... i mean i want to replace all the line of the file by these new output lines. i.e (the line contain sample instead of sample.gz) Last edited by subhendu81; 09-12-2008 at 01:54 AM.. Reason: to remove the smileys |
|
||||
|
Or if you want to unzip and echo out the resulting unzipped file name, try gzip -dv -- it will print a message for each file (albeit not in a very machine-readable form). Or perhaps try this:
Code:
sed -n 's/\.gz//p' file | tee outputfile | while read match; do gzip -d "$match".gz done |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|