hi experts,
how can i separate the files contaiing several lines as
/common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample.gz
/common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample1.gz
i mean i want 2 separate the files sample.gz and sample1.gz and redirect them into an output file.
grep '\.gz$' file |
while read match; do
gzip -d "$match"
# unclear what you mean by "absolute path which is defined in that file" ...
# defined how, in which file?
done
hi experts,
how can i separate the files contaiing several lines 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 mean i want 2 cut the files sample.gz and sample1.gz and redirect them into an output file.
my requirement are:
1.i have to find the zip files from the file
2.unzip all the files
3.again save the unzipfiles with absolute path which is defined in that file.
hi,
how can i separate the files contaiing several lines 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 mean i want 2 cut the files sample.gz and sample1.gz and redirect them into an output file.
my requirement are:
1.i have to find the zip files from the file
2.unzip all the files
3.again save the unzipfiles with absolute path which is defined in that file.
hi,
how can i separate the files contaiing several lines 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 mean i want 2 cut the files sample.gz and sample1.gz and redirect them into an output file.
my requirement are:
1.i have to find the zip files from the file
2.unzip all the files
3.again save the unzipfiles with absolute path which is defined in that file.
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
...
...
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:
sed -n 's/\.gz//p' file |
tee outputfile |
while read match; do
gzip -d "$match".gz
done
This will decompress each matched file and print the file names sans .gz extension to outputfile