This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
RE: Question(may be a Bug) to gsub () function of awk from GNU WI N32 Beta 19
- TO: gnu-win32 at cygnus dot com
- Subject: RE: Question(may be a Bug) to gsub () function of awk from GNU WI N32 Beta 19
- From: Wolfgang_Hauser at Non-HP-Germany-notes1 dot om dot hp dot com
- Date: Mon, 27 Apr 98 08:49:03 +0200
Thanks Bob,
if i do the substitution in the way you described, and it will work on all
platforms.
Bye
Wolfgang
From: bob.mcgowan@artecon.com/HP-Germany/mimegw13 on 04/25/98 02:37 AM CED
To: gnu-win32@cygnus.com/HP-Germany/mimegw13@BBN-GW1
cc: bob.mcgowan@artecon.com/HP-Germany/mimegw13@BBN-GW1
Subject: RE: Question(may be a Bug) to gsub () function of awk from GNU WI
N32 Beta 19
___________________________________________________
Wolfgang,
I have seen discussion of a similar problem in the comp.lang.awk
newsgroup. Basically, the comments indicate that using the gsub() with
a quoted string as the first argument is the source of the problem.
gsub() expects a regular expression and so there is a string to regex
conversion, losing the escape char (\) and creating a regex of /|/ in
which (I assume) the pipe symbol has some special meaning.
So try replacing the "\|" with /\|/ (note no quotes).
I am afraid I do not have a setup to actually try this so I cannot
confirm that it really works.
---
Bob McGowan
i'm: bob dot mcgowan at artecon dot com
-----Original Message-----
From: Wolfgang_Hauser@Non-HP-Germany-notes1.om.hp.com
[mailto:Wolfgang_Hauser@Non-HP-Germany-notes1.om.hp.com]
Sent: Friday, April 24, 1998 4:53 AM
To: gnu-win32@cygnus.com
Subject: Question(may be a Bug) to gsub () function of awk from GNU
WIN32 Beta 19
I tryed to replace all "|" (Pipe sign) with " " (Blanks) by the
function call:
gsub("\|"," ",scr_line)
the result is, after every character of the variable src_line appears a
" "
Blank.
With an other awk (under POSIX) the function replaces the "|" properly
by
Blank and don't affect the other characters.
Does anybody know something about this ?
Wolfgang
-
For help on using this list (especially unsubscribing), send a message
to
"gnu-win32-request@cygnus.com" with one line of text: "help".
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
Binary data