Thanks for the tips....I have it working on my HP boxes and Redhat boxes now.
I am running this as part of a KSH script so i still need the quote processing.
Here is the current code (i added a few more symbols).
Im not sure why but for whatever reason Solaris does not like this. I keep getting the following error.
Just to be sure I understand what you're saying, you have a ksh shell script that at some point contains something like:
and you have chosen to use the call to gsub() shown above rather than the suggestion I made in an earlier post:
because you now also want to change the characters <period>, <dollar-sign>, <hyphen>, <at-sign>, and <percent-sign> to a <space> in addition to the characters you were changing before. Is that correct?
Note that having $-@ in a bracket expression in the 1st argument to gsub after quote removal is a range expression matching <dollar-sign>, <at-sign> and everything that comes between them in your current locale definition. In the POSIX locale, that should match the following characters
not just the $, -, and @.
I put together an input file to use to test various calls to gsub:
in.gsubspecial:
and used the following commands in a shell script to test out three sample
gsub() calls I produced and the gsub call you have above.
When I run this script, I get the following output:
I don't know why your gsub wouldn't work with /usr/xpg4/bin/awk on Solaris 10. (Is there any chance that you're using a Locale with a non-standard setting for the LC_COLLATE category? Are you sure that you are using exactly the same script on Solaris 10 that you're using on the other systems? Having another single-quote anywhere in your awk script [even in a comment] could greatly change the behavior.) I do see that your gsub() call fails to change a backslash character into a space. If you intended to use the $-@ as a range expression, we can get rid of several character in the matching list expression that are not only listed individually, but are also included in the range expression (including the single-quote).
Hopefully, this will give you something you can adapt to something you can use.
Hello
I have problem with reg-expr and function gsub();
File that I want to preprocess look like this:
int table ;
printf(" variable : ", variable) ;
Using nawk I try something like this:
for ( .... )
{
line = $0
reg_expr = "\.\=]*" "" variable "" "\.\=]*" ;
gsub( reg_expr... (1 Reply)
Hello,
I have a variable that displays the following results from a JVM....
1602100K->1578435K
I would like to collect the value of 1578435 which is the value after a garbage collection. I've tried the following command but it looks like I can't get the > to work. Any suggestions as... (4 Replies)
I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly:
if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Hello,
i'm searching for a solution to this problem.
I have 2 files, the first one is like:
<HTML>
<HEAD>
<TITLE>{$String1}</TITLE>
</HEAD>
<BODY>
<P>{$String2}</P>
</BODY>
</HTML>and the other one:
{$String1}; french
{$String2}; italian
{$String3}; english
...
{$StringN};
I... (3 Replies)
Hi, I want to print the first column with original value and without any double quotes
The output should look like
<original column>|<column without quotes>
$ cat a.txt
"20121023","19301229712","100397"
"20121023","19361629712","100778"
"20121030A","19361630412","100838"... (3 Replies)
I have a number of files that I pass through awk/gsub.
I believe to have found a working regex and on 'test bed' sites it matches, however within gsub it does not.
Examples:
Initial data:
/Volumes/Daniel/Public/Drop Box/_Hellsing_Ultimate_OVA_-_10_.mkv
gsub & regex:
gsub("\]+\]",""
... (4 Replies)
I am not a big expert in regex and have just little understanding of that language.
Could you help me to understand the regular Perl expression:
^(?!if\b|else\b|while\b|)(?:+?\s+){1,6}(+\s*)\(*\) *?(?:^*;?+){0,10}\{
------
This is regex to select functions from a C/C++ source and defined in... (2 Replies)
I'm trying to get some exclusions into our sendmail regular expression for the K command. The following configuration & regex works:
LOCAL_CONFIG
#
Kcheckaddress regex -a@MATCH
+<@+?\.++?\.(us|info|to|br|bid|cn|ru)
LOCAL_RULESETS
SLocal_check_mail
# check address against various regex... (0 Replies)