delete to end of formatted warnings using sed or cut...

hi, i've searched the forums' entries and have tried some of the examples -- to no avial -- this is my first post -- thanks in advance for your help...

As part of an installation program -- i'm receiving two(2) extraneous "libcxb WARNING!" statements -- i want to use sed to eliminate the appearance of these warnings...

The warnings appear as follows:

libxcb: WARNING! Program tries to unlock a connection without having acquired
a lock first, which indicates a programming error.
There will be no further warnings about this issue.
libxcb: WARNING! Program tries to lock an already locked connection,
which indicates a programming error.
There will be no further warnings about this issue.

Note, the warnings appear to be formatted in such a way that the 2nd & 3rd lines in each warning always appear in the same position. Nevertheless, I want to eliminate the entire warning, i.e., everything from libxcb: to ...about this issue.

Could some please help... thx very much!

installscript.sh | sed '/^libxcb/,/this issue\.$/d'

That will block the error message. Chances are your message is not extraneous, unless there is a problem with libxcb code.

Thanks Jim,

unfortunately, with the changes in place, i still see both 'libxcb:' warnings... the syntax is as you prescribed

installScript.sh | sed '/^libxcb/,/this issue\.$/d'

did i miss something... please let me know & thx!

If that output is going to stderr instead of stdout try:

installscript.sh  &2>1 | sed '/^libxcb/,/this issue\.$/d'

Thanks Jim, there's some progress -- however the 'libxcb' warning have just moved further down -- i.e., the install progress further before the warnings appear... any ideas...?

previously,
*******************
Press any key to continue.
awk: cmd. line:6: warning: escape sequence `\.' treated as plain `.'
libxcb: WARNING! Program tries to unlock a connection without having acquired
a lock first, which indicates a programming error.
There will be no further warnings about this issue.
libxcb: WARNING! Program tries to lock an already locked connection,
which indicates a programming error.
There will be no further warnings about this issue.

with latest changes,
********************
Press any key to continue.

Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
awk: cmd. line:6: warning: escape sequence `\.' treated as plain `.'
Launching installer...
libxcb: WARNING! Program tries to unlock a connection without having acquired
a lock first, which indicates a programming error.
There will be no further warnings about this issue.
libxcb: WARNING! Program tries to lock an already locked connection,
which indicates a programming error.
There will be no further warnings about this issue.
*********************

install.sh | awk '/this issue/{f=0;next}/^libxcb/{f=1}f{next}f==0'

Thanks ghost... i applied your suggestion, but the warnings continue to appear -- I understand these underlying errors are somewhat well-known(notorious) JRE issues... that many folks have chosen to ignore -- i just want to 'mask' them from my users so I can avoid questions... etc

So, I appreciate very much the insights -- and hopefully your continued help -- if there's anyway to mask these -- I'd really appreciate finding a solution.

it works for me

# more file

Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
awk: cmd. line:6: warning: escape sequence `\.' treated as plain `.'
Launching installer...
libxcb: WARNING! Program tries to unlock a connection without having acquired
a lock first, which indicates a programming error.
There will be no further warnings about this issue.
libxcb: WARNING! Program tries to lock an already locked connection,
which indicates a programming error.
There will be no further warnings about this issue.

# awk '/this issue/{f=0;next}/^libxcb/{f=1}f{next}f==0' file

Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
awk: cmd. line:6: warning: escape sequence `\.' treated as plain `.'
Launching installer...

thanks ghost...

i'm applying your suggestion to the output of < ${PATH_TO_APPS}/*.bin >

${PATH_TO_APPS}/*.bin | awk '/this issue/{f=0;next}/^libxcb/{f=1}f{next}f==0'

the output continues to show:

Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
awk: cmd. line:6: warning: escape sequence `\.' treated as plain `.'
Launching installer...
libxcb: WARNING! Program tries to unlock a connection without having acquired
a lock first, which indicates a programming error.
There will be no further warnings about this issue.
libxcb: WARNING! Program tries to lock an already locked connection,
which indicates a programming error.
There will be no further warnings about this issue.

********************

i need the 'awk' expression to take the output of <
${PATH_TO_APPS}/*.bin > and eliminate the warnings... what am i missing...?

then change /^libxb/ to /^libxb|awk/

thanks ghost -- i appreciate your guidance --

i changed

${PATH_TO_APPS}/*.bin | awk '/this issue/{f=0;next}/^libxcb/{f=1}f{next}f==0'

to

${PATH_TO_APPS}/*.bin | awk '/this issue/{f=0;next}/^libxcb|awk/{f=1}f{next}f==0'

i still see the WARNINGS appearing -- no change in the output...

please help --

-rickkar

it works ok for me.

# awk '/this issue/{f=0;next}/^libxcb|awk/{f=1}f{next}f==0' file
Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...

thanks ghost,

just so we're on the same page, i'm trying to run this as part of an script that calls a .bin from someplace defined in {PATH_TO_APPS} -- the warnings are thrown when the JRE gets unpacked --

as i noted in one of my previous posts -- these JRE warnings are well-known and I just want to mask them from customers

is there any issue with what i've described that would prevent the awk expressions we've tried from operating correctly -- what are some other explanations...?

please stay with me -- i need to get this working...

-rickkar