delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/04/25/00:56:56

From: bob DOT mcgowan AT artecon DOT com (Bob McGowan)
Subject: RE: Question(may be a Bug) to gsub () function of awk from GNU WI
N32 Beta 19
25 Apr 1998 00:56:56 -0700 :
Message-ID: <8B40B8756FA1D111BCB900A02495E24F36B43D.cygnus.gnu-win32@neptune.xstor.com>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

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 AT Non-HP-Germany-notes1 DOT om DOT hp DOT com
[mailto:Wolfgang_Hauser AT Non-HP-Germany-notes1 DOT om DOT hp DOT com]
Sent: Friday, April 24, 1998 4:53 AM
To: gnu-win32 AT cygnus DOT 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 AT cygnus DOT com" with one line of text: "help".
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019