- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Output redirection
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2008 07:22 PM
тАО10-25-2008 07:22 PM
Output redirection
I need to redirect check_patches output to a file.Is there any way to get it as it apprears on the screen.When I diect with '>' it is giving scattered o/p as the count increases.
Thanks,
sen
- Tags:
- redirect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2008 10:36 PM
тАО10-25-2008 10:36 PM
Re: Output redirection
the thing is which format you wanna see the output. If you open it using note pad, the output will be scattered.
if you use windows word pad it will show you the exact way u have seen in HP-UX box's.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2008 01:50 AM
тАО10-26-2008 01:50 AM
Re: Output redirection
I would like see the o/p like this.
Checking installed version of /usr/sbin/swconfig
Checking for invalid patches
Checking object module checksums for active patch fileset 783 of 783
Checking patch filesets for active patch 412 of 412
Checking state for patch fileset 1588 of 1588
Checking patch_state for patch fileset 1588 of 1588
Running swverify on all patch filesets, this may take several minute
It apprears like this on screen ( Using carriage return).
But if i redirect, each line will be printed.
Like this.
Checking object module checksums for active patch fileset 1 of 783
Checking object module checksums for active patch fileset 2 of 783
Checking object module checksums for active patch fileset 3 of 783
Checking object module checksums for active patch fileset 4 of 783
Checking object module checksums for active patch fileset 5 of 783
Checking object module checksums for active patch fileset 6 of 783
Checking object module checksums for active patch fileset 7 of 783
Checking object module checksums for active patch fileset 8 of 783
Checking object module checksums for active patch fileset 9 of 783
Checking object module checksums for active patch fileset 10 of 783
Checking object module checksums for active patch fileset 11 of 783
Checking object module checksums for active patch fileset 12 of 783
I hope u got what i need.
Is it stupid question.?
Regds
Sen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2008 03:13 AM
тАО10-26-2008 03:13 AM
Re: Output redirection
Seen the above, I'm guessing that these lines are updated 'live' when you're running it without redirection. That would explain that, when you redirect the output, every update is written to your file.
I see that the check_patches utility logs all information to /tmp/check_patches.report. Maybe that file can help you out ?
Cheers,
Wout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2008 04:01 AM
тАО10-26-2008 04:01 AM
Re: Output redirection
That's why you redirect it. You can then edit the file as you like. Or you can write a script to delete the progress info:
grep -v "Checking object module checksums for active patch" file > file.new
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2008 04:07 AM
тАО10-26-2008 04:07 AM
Re: Output redirection
# sed -n -e '
/[0-9][0-9]* of [0-9][0-9]*/ !{p;}
/\([0-9][0-9]*\) of \1/ {p;}
' outputfile > outputfile.new
..for example. There probably a bunch of ways to do it (sed,awk,perl,..)
Cheers,
Wout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2008 04:28 AM
тАО10-26-2008 04:28 AM
Re: Output redirection
Wouter is correct. By design, 'check_patches' uses carriage-return characters to overwrite the lines it produces to show the file counts on STDOUT (your terminal). Thus you see only a summary of each pass.
There is no need to redirect the output to a file for later viewing, since 'check_patches' automatically produces the file ' /tmp/check_patches.report' that summarizes the results and lists any issues found. This is documented in its manpages.
You won't see the same output in '/tmp/check_patches.report' that you do on your terminal, though. If you wanted both outputs, you could do:
# check_patches | tee /tmp/mycheckpatches
# perl -pi -e 's/\015/\012/g' /tmp/mycheckpatches
...now, the '/tmp/mycheckpatches' file will hold the details of what you saw on your terminal. You will still have the standard 'check_patches.report' too.
Regards!
...JRF...