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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting delete to end of formatted warnings using sed or cut...
# 1  
Old 05-08-2009
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!
# 2  
Old 05-08-2009
Code:
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.
# 3  
Old 05-08-2009
delete to end of formatted warnings using sed or cut...

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!
# 4  
Old 05-08-2009
If that output is going to stderr instead of stdout try:
Code:
installscript.sh  &2>1 | sed '/^libxcb/,/this issue\.$/d'

# 5  
Old 05-08-2009
delete to end of formatted warnings using sed or cut...

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.
*********************
# 6  
Old 05-08-2009
Code:
install.sh | awk '/this issue/{f=0;next}/^libxcb/{f=1}f{next}f==0'

# 7  
Old 05-08-2009
delete to end of formatted warnings using sed or cut...

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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cut the strings from end

could you please help me. I have below autosys jobs 01_enable_input_hol_dtpz1b 01_abc_copy_ld_sat_xxxz1 01_abc_mavcd_yyyyyxxxz1 01_abcdef_oa_xxxxxz1 01_fdgte_symbol_ddddz1 01_fsdfsd_clean_mmmhhhfz1 01_fsdfd_create_mut_marchtz1 I want to remove name after last "_" underscore so that... (6 Replies)
Discussion started by: sdosanjh
6 Replies

2. Shell Programming and Scripting

awk, sed, perl assistance in outputting formatted file

Hello, Please advise. Scoured this site, as well as google for answers. However if you do not know what to search for, it's a bit hard to find answers. INPUT: ACTASS= 802 BASECOS= 279 COSNCHG= 3 CUSCOS= 52 UPLDCOS= 2 DESIRED OUTPUT: ACTASS=802 BASECOS=279 (13 Replies)
Discussion started by: abacus
13 Replies

3. Shell Programming and Scripting

cut but include delimiter at end

Can someone please tell me how to do this... input file - /etc/group: wheel:*:0:root,timber daemon:*:1: mysql:*:88: ...etc... giants:*:1001:dalton,bandit dalton:*:1002: bandit:*:1003: output file (my goal): giants:*:1001: dalton:*:1002: bandit:*:1003:I've come up with this: ... (3 Replies)
Discussion started by: Lewcifer
3 Replies

4. UNIX for Advanced & Expert Users

Urgent Help required : awk/sed help to find pattern and delete till end of line

Hi, I need help with using an awk or sed filter on the below line ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE Look for... (1 Reply)
Discussion started by: rajan_san
1 Replies

5. Shell Programming and Scripting

Urgent! Sed/Awk Filter Find Pattern Delete Till End Of Line

Hi, I need help with using an awk or sed filter on the below line ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE Look for... (2 Replies)
Discussion started by: rajan_san
2 Replies

6. Shell Programming and Scripting

delete to end of line with SED

I have a file with a bunch of similar lines in which I want to extract a phrase delimited by the first occurance of a '>' at the beginning and the first occurance of a '<' at the end (you might have guessed these are beginning/end of HTML tags). Using Sed I have managed to delete up to and... (7 Replies)
Discussion started by: coldcanuck
7 Replies

7. Shell Programming and Scripting

cut from a particular character to the end of the string

Hi All, I have a string like "9633C01302_2". I need to extract the number(02) after "13" and before "_" and the number coming after "13" and before "_" is not constant, it keeps on changing... Can some one plz help me wth the command.. i tried this echo "9633C01302_2" | cut -d'_' -f1 ..But... (2 Replies)
Discussion started by: grajesh_955
2 Replies

8. Shell Programming and Scripting

cut - columns with formatted Output

Hi I have the input file as below ***TEST10067 00567GROSZ 099 00567CTCTSDS90 ***TEST20081 08233GROZWEWE 00782GWERW899 ***TEST30088 08233GROZWEWE 00782GWERW899 I am finding the lines starting with *** and outputing as below TEST10067 TEST20081 TEST30088 I need a space between TEST1... (9 Replies)
Discussion started by: dhanamurthy
9 Replies

9. Shell Programming and Scripting

To cut end string from line

HI, I want to cut end string from line. e.g. i have following input line /users/home/test.txt I want to get end string 'test.txt' from above line and length of that end string will change and it always start after '/'. Thanks, Visu (7 Replies)
Discussion started by: visu
7 Replies

10. UNIX for Dummies Questions & Answers

SED: How to delete from expression to end of line

I have the following line(s) of text in a file: Card: H'00f2 Elapsed Time (day - h:m:s): 0 - 21:14:18.5 I basically want to search for "Elapsed Time", then delete this and everything else to the end of the line. I've tried a lot of different things, but cannot seem to get rid of... (1 Reply)
Discussion started by: rtstanley
1 Replies
Login or Register to Ask a Question