- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script to list patches applied to system
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
тАО11-12-2004 06:13 AM
тАО11-12-2004 06:13 AM
Background:
When applying patches to the system, and after I go through matching what target has, it selects what patches should be applied. At this point I cancel back to the main window and the print to a file the list of patches that are going to be applied.
From this point I grep through the file looking for "Partial" or "Yes" and if I find it I write file "A". I then cat file "A" and pipe it to awk printing only the patch identifiers into a file. My problem comes in the next step when I want to take that file and instead of having one file with 20 rows, have one file with one row of all patches strung together. I can then copy this string of characters and put it into an excel spreadsheet.
Any Ideas?
Regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2004 06:25 AM
тАО11-12-2004 06:25 AM
Re: Script to list patches applied to system
Post your script for more appropriate answers.
If I understood your message correctly, you are creating a file with the contents like
PHCO_21000
PHCO_22000
PHNE_23000
etc., and you want the output to be PHCO_21000 PHCO_22000 PHNE_23000 etc.,
A quick and dirty way is to use something like this
while read line
do
printf "$line " >> outfile
done < your_file
printf "\n:" >> outfile
-Sri
- Tags:
- printf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2004 06:28 AM
тАО11-12-2004 06:28 AM
Re: Script to list patches applied to system
e.g printf "%s \t" $1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2004 06:30 AM
тАО11-12-2004 06:30 AM
Re: Script to list patches applied to system
sed :a;$!N;s/\n//;ta; INFILE > OUTFILE
Rgds...Geoff
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2004 07:12 AM
тАО11-12-2004 07:12 AM
Re: Script to list patches applied to system
Yes Sri the input file is exactly as you indicate.
Here is what I have so far, also incorperating printf instead of only print.
grep -i -e partial -e yes print_info|awk '{ printf $2 }'
this results in:
PHCO_27138PHCO_29072PHCO_29675PHCO_29692PHCO_29816PHCO_29829PHCO_29833PHCO_29895
PHCO_29905PHCO_30075PHCO_30243PHCO_30275PHCO_30361PHCO_30397PHCO_30402PHCO_30420
So close..... I need to get a space or comma or tab between them. I have tried Bill's suggestion but must have something "out of whack".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2004 07:55 AM
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2004 07:57 AM
тАО11-12-2004 07:57 AM
Re: Script to list patches applied to system
Modify it as
grep -i -e partial -e yes print_info|awk '{ printf "%s ", $2}'
There is a space after s.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2004 11:55 PM
тАО11-14-2004 11:55 PM