grep help with pkginfo


 
Thread Tools Search this Thread
Operating Systems Solaris grep help with pkginfo
# 1  
Old 01-27-2010
grep help with pkginfo

im looking for a way to eliminate the packages from SUN when i do a pkginfo. thought this would work, but no luck.

Code:
 
pkginfo | grep [^SUNW]

what am i doing wrong?
Thanks
# 2  
Old 01-27-2010
You are filtering lines containing a single letter S or U or N or W.

What you need is
Code:
pkginfo | grep -v " SUNW"

or - more precise
Code:
pkginfo | nawk '$2 !~ /^SUNW.*/ { print }'

because the package name is not at the beginning of each line but in the second column.
# 3  
Old 01-28-2010
Quote:
Originally Posted by jrich523
im looking for a way to eliminate the packages from SUN when i do a pkginfo. thought this would work, but no luck.

Code:
 
pkginfo | grep [^SUNW]

what am i doing wrong?
Thanks
use grep -v option
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inconsistent `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`

i have this line of code that looks for the same file if it is currently running and returns the count. `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l` basically it is assigned to a variable ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies

2. Solaris

Host name in front of pkginfo output

hello all I am trying to create a comma seperated file of the pkginfo command. The follwoing works pretty well. pkginfo -l | egrep '(BASEDIR|NAME|VERSION)' | awk '{print}' ORS=', ' however, there are two issues. 1, For some reason it does not load into excel properly. It loads as... (7 Replies)
Discussion started by: busi386
7 Replies

3. Solaris

pkgadd, pkginfo, ssh not working

Got a feeling someone has been fiddling around or something has got corrupt but I'm getting the following errors now:- -bash-3.00# pkginfo ld.so.1: pkginfo: fatal: libssl.so.0.9.7: open failed: No such file or directory Killed -bash-3.00# and also ssh:- -bash-3.00# ssh ld.so.1: ssh:... (5 Replies)
Discussion started by: psychocandy
5 Replies

4. UNIX for Dummies Questions & Answers

Bash - CLI - grep - Passing result to grep through pipe

Hello. I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv" lsmod | (e)grep '^nv???????????? I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long ... (1 Reply)
Discussion started by: jcdole
1 Replies

5. AIX

BMC package and ingeneral all packages in AIX (Similar to pkginfo in Linux)

Hi , I want to know is there any command in AIX similar to pkginfo ? that shows details of all packages installed and we can grep whatever we need to check? Thanks Rafi (2 Replies)
Discussion started by: rafi49
2 Replies

6. UNIX for Advanced & Expert Users

rpm and pkginfo question

Can the root hide some of the results of the above commands from a regular user? i.e. $>rpm and $>sudo rpm will give different results (1 Reply)
Discussion started by: noam128
1 Replies

7. UNIX for Dummies Questions & Answers

| help | unix | grep (GNU grep) 2.5.1 | advanced regex syntax

Hello, I'm working on unix with grep (GNU grep) 2.5.1. I'm going through some of the newer regex syntax using Regular Expression Reference - Advanced Syntax a guide. ls -aLl /bin | grep "\(x\)" Which works, just highlights 'x' where ever, when ever. I'm trying to to get (?:) to work but... (4 Replies)
Discussion started by: MykC
4 Replies

8. Solaris

difference between pkginfo and pkgchk command

can anyone explain me the difference between pkginfo and pkgchk command in solaris. Both are used to display the package details, then what is the difference between both. (5 Replies)
Discussion started by: rogerben
5 Replies

9. Shell Programming and Scripting

MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else

Hi Guys, I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys. MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' ` Harby. (4 Replies)
Discussion started by: hariza
4 Replies

10. UNIX for Dummies Questions & Answers

format and pkginfo -l question

I have a Solaris 2.6 box flagging an "Error block: 308918" in the messages file when I execute a pkginfo -l. pkginfo with no flags returns no errors. I think I need to use format to mark this block and then restore the database used by pkginfo for backup. Any advice/input welcome. Thanks (4 Replies)
Discussion started by: 98_1LE
4 Replies
Login or Register to Ask a Question