Unix help!
#1
Scooby Senior
Thread Starter
Join Date: Dec 2000
Location: North Wales
Posts: 5,826
Likes: 0
Received 0 Likes
on
0 Posts
Unix help!
Right,
I have a .zip file on an AIX box, and if I unzip it using unzip, it's unzips the contents (as you'd expect).
However, I only want one of the files in there to be unzipped, and I want to change the name of it when is unzipped, all in one go, as there may be several of these zip files in the directory, all containing an "out.log" and there will be a need to unzip more than one file per day.
The files are job logs from TWS, on a zCentric agent, so the old STDLIST sturcture has gone from the old styl FTAs (for thos Unix bods who have across TWS.......)
Any ideas?
Geezer
I have a .zip file on an AIX box, and if I unzip it using unzip, it's unzips the contents (as you'd expect).
However, I only want one of the files in there to be unzipped, and I want to change the name of it when is unzipped, all in one go, as there may be several of these zip files in the directory, all containing an "out.log" and there will be a need to unzip more than one file per day.
The files are job logs from TWS, on a zCentric agent, so the old STDLIST sturcture has gone from the old styl FTAs (for thos Unix bods who have across TWS.......)
Any ideas?
Geezer
#2
Scooby Regular
Join Date: Mar 2000
Location: Gloucestershire, home of the lawnmower.
Posts: 4,531
Likes: 0
Received 0 Likes
on
0 Posts
Mental blank on piping but how about:
unzip -p YourZipFile out.log > mynewfilename.log
If the out.log is in a subfolder of the zip, you need to full relative path to it from the root of the ZIP. E.g. if in the zip is it located at /logs/out.log the command would be:
unzip -p YourZipFile logs/out.log > mynewfilename.log
It has been 100 years since I did any Unix.
Sorry
Cheers
Ian
unzip -p YourZipFile out.log > mynewfilename.log
If the out.log is in a subfolder of the zip, you need to full relative path to it from the root of the ZIP. E.g. if in the zip is it located at /logs/out.log the command would be:
unzip -p YourZipFile logs/out.log > mynewfilename.log
It has been 100 years since I did any Unix.
Sorry
Cheers
Ian
Last edited by IWatkins; 03 May 2012 at 04:07 PM. Reason: Brainwave
Thread
Thread Starter
Forum
Replies
Last Post