Advertisement

03.17.2008 at 10:52PM PDT, ID: 23249363
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

unix command line

Tags: unix command line
I'm trying to pull out the device drivers from pkginfo -l output.  Below is the sample output:   PKGINST:  SUNWauda
      NAME:  Audio Applications
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  11.8.0,REV=2000.01.08.18.12
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  SunOS audio applications
    PSTAMP:  on28-patch20050301131544
  INSTDATE:  Mar 08 2007 12:11
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:        3 installed pathnames
                   2 shared pathnames
                   2 directories
                   1 executables
                  24 blocks used (approx)

   PKGINST:  SUNWaudd
      NAME:  Audio Drivers
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  11.8.0,REV=2000.01.08.18.12
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  SunOS audio device drivers using the new audio driver architecture
    PSTAMP:  on28-patch20050301131547
  INSTDATE:  Mar 08 2007 12:11
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:       30 installed pathnames
                   6 shared pathnames
                   6 directories
                   7 executables
                 666 blocks used (approx)
When I use grep and awk, this is what I get:

# more /tmp/software_list | grep drivers
      DESC:  SunOS audio device drivers using the new audio driver architecture
      DESC:  SunOS audio device drivers using the new audio driver architecture (64-bit)
      DESC:  SunOS C/C++ header files for audio drivers and applications
      DESC:  kernel device drivers for dumb frame buffers
      NAME:  Device drivers for I2C devices, (Root, 32-bit)
      DESC:  Device drivers for I2C devices, (Root, 32-bit)
      NAME:  Device drivers for I2C devices, (Root, 64-bit)
      DESC:  Device drivers for I2C devices, (Root, 64-bit)
      NAME:  IDE device drivers
      DESC:  IDE device drivers updated for UltraAX
      NAME:  IDE device drivers- 64bit
      DESC:  IDE device drivers - 64bit, updated for UltraAX
      DESC:  64 bit kernel device drivers implementing IEEE 802.2 Logical Link Control 2 service
      DESC:  kernel device drivers implementing asynchronous point-to-point protocol (PPP)
      DESC:  64-bit kernel device drivers implementing asynchronous point-to-point protocol (PPP)
      NAME:  SuperIO 307 (plug-n-play) device drivers, (Root)
      DESC:  SuperIO 307 (plug-n-play) device drivers, (Root)
      NAME:  SuperIO 307 (plug-n-play) device drivers, (Root)
      DESC:  SuperIO 307 (plug-n-play) device drivers, (Root)
      DESC:  pln, soc, and ssd kernel device drivers
      DESC:  pln, soc, and ssd kernel device drivers (64-bit)
      DESC:  kernel device drivers for X Windows System
      DESC:  64-bit kernel device drivers for X Windows System
      NAME:  GFX drivers for Solaris 2 (v2.1)
      DESC:  TSI Raptor GFX drivers for Solaris 2
#
I need to get all of the information about the driver and direct it to an output file:

 PKGINST:  SUNWaudd
      NAME:  Audio Drivers
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  11.8.0,REV=2000.01.08.18.12
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  SunOS audio device drivers using the new audio driver architecture
    PSTAMP:  on28-patch20050301131547
  INSTDATE:  Mar 08 2007 12:11
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:       30 installed pathnames
                   6 shared pathnames
                   6 directories
                   7 executables
                 666 blocks used (approx)

Start your free trial to view this solution
Question Stats
Zone: OS
Question Asked By: b0nniedog
Solution Provided By: b0nniedog
Participating Experts: 2
Solution Grade: A
Views: 8
Translate:
Loading Advertisement...
03.17.2008 at 11:34PM PDT, ID: 21148755

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.18.2008 at 04:04AM PDT, ID: 21149698

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.18.2008 at 08:02AM PDT, ID: 21151770

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.18.2008 at 11:55AM PDT, ID: 21154495

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.18.2008 at 12:03PM PDT, ID: 21154581

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.18.2008 at 12:09PM PDT, ID: 21154630

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.18.2008 at 12:23PM PDT, ID: 21154778

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.18.2008 at 12:32PM PDT, ID: 21154887

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.18.2008 at 12:34PM PDT, ID: 21154907

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.18.2008 at 12:37PM PDT, ID: 21154942

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
03.17.2008 at 11:34PM PDT, ID: 21148755

Rank: Master

Try the following

for pkg in `pkginfo | grep -i driver`
do
pkginfo -l $pkg >> pkgs.log
done
 
03.18.2008 at 04:04AM PDT, ID: 21149698

Rank: Guru

grep isn't really up to this, you are going to have to write an awk program.
Read each package into an array. Package starts with PKGINST: and ends with a blank line or maybe the "n blocks used" line.
Examine the NAME and DESC lines for "driver" or "drivers" (capitalized or not).
If you get a match, print all lines in the array. Empty the array and read the next package group...
 
03.18.2008 at 08:02AM PDT, ID: 21151770
Hi duncan,

I'm so not good in awk.  can you elaborate on this?  thanks
 
03.18.2008 at 11:55AM PDT, ID: 21154495
Does anyone has any answers that I'm looking for?  Maybe awk and/or grep is not the solution.  Please advise.
 
03.18.2008 at 12:03PM PDT, ID: 21154581

Rank: Master

Did you try the solution I gave? Any problem encountered with it?
 
03.18.2008 at 12:09PM PDT, ID: 21154630
Omarfarid, yes I did.  It still gave me the same output to that of grep and awk that I ran:
DESC:  SunOS audio device drivers using the new audio driver architecture
      DESC:  SunOS audio device drivers using the new audio driver architecture (64-bit)
      DESC:  SunOS C/C++ header files for audio drivers and applications
      DESC:  kernel device drivers for dumb frame buffers
      NAME:  Device drivers for I2C devices, (Root, 32-bit)
      DESC:  Device drivers for I2C devices, (Root, 32-bit)
      NAME:  Device drivers for I2C devices, (Root, 64-bit)
      DESC:  Device drivers for I2C devices, (Root, 64-bit)
      NAME:  IDE device drivers
      DESC:  IDE device drivers updated for UltraAX
      NAME:  IDE device drivers- 64bit
      DESC:  IDE device drivers - 64bit, updated for UltraAX
      DESC:  64 bit kernel device drivers implementing IEEE 802.2 Logical Link Control 2 service
      DESC:  kernel device drivers implementing asynchronous point-to-point protocol (PPP)
      DESC:  64-bit kernel device drivers implementing asynchronous point-to-point protocol (PPP)
      NAME:  SuperIO 307 (plug-n-play) device drivers, (Root)
      DESC:  SuperIO 307 (plug-n-play) device drivers, (Root)
      NAME:  SuperIO 307 (plug-n-play) device drivers, (Root)
      DESC:  SuperIO 307 (plug-n-play) device drivers, (Root)
      DESC:  pln, soc, and ssd kernel device drivers
      DESC:  pln, soc, and ssd kernel device drivers (64-bit)
      DESC:  kernel device drivers for X Windows System
      DESC:  64-bit kernel device drivers for X Windows System
      NAME:  GFX drivers for Solaris 2 (v2.1)
 
03.18.2008 at 12:23PM PDT, ID: 21154778

Rank: Master

I am sorry, it seams I posted incomplete script. Please try

for pkg in `pkginfo | grep -i driver | awk '{print $2}'`
do
pkginfo -l $pkg >> pkgs.log
done
Assisted Solution
 
03.18.2008 at 12:32PM PDT, ID: 21154887
# for pkg in `pkginfo | grep -i driver | awk '{print $2}'`;do pkginfo -l $pkg >> pkgs.log;done
for: Command not found.
pkg: Undefined variable.
Accepted Solution
 
03.18.2008 at 12:34PM PDT, ID: 21154907

Rank: Master

Which sell are you using? Please run it under sh or ksh
 
03.18.2008 at 12:37PM PDT, ID: 21154942
nevermind. that worked!  thanks omarfarid.
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628