1834495 Members
3331 Online
110067 Solutions
New Discussion

Scripting question

 
SOLVED
Go to solution
Matthew Murdock
Valued Contributor

Scripting question

I need to strip out the uppercase header of the cmviewcl -l package or other cmviewcl commands output.
When I run cmviewcl -l package | awk '{print $1}' I get the following....How can I obliterate the PACKAGE from showing up on the output?
PACKAGE
pkg1
pkg2
pkg3
pkg4
5 REPLIES 5
Geoff Wild
Honored Contributor
Solution

Re: Scripting question

cmviewcl -l package | grep -v PACKAGE | awk '{print $1}'


Rgds..Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
James R. Ferguson
Acclaimed Contributor

Re: Scripting question

Hi Matthew:

# awk '{if (NR>1) {print}}'

...would always skip the first line...

Regards!

...JRF...
Matthew Murdock
Valued Contributor

Re: Scripting question

Of course I was making it more difficult than necessary. I had what I wanted for about 3 months, then I overwrote what I had done and well, you get the rest of the picture. Thanks.
Geoff Wild
Honored Contributor

Re: Scripting question

And this works as well:

cmviewcl -l package |grep bled | awk '{print $1}'

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Muthukumar_5
Honored Contributor

Re: Scripting question

Another try as,

cmviewcl -l package | awk '!/PACKAGE/ {print $1}'

hth.
Easy to suggest when don't know about the problem!