I have an array containing bunch of characters. I have to check this array for specific character and if "Not Found than" use a goto statement to go to USAGE
Code:
set options = (A B C D E F)
@ i = 0
while ($i <= ${#options})
if ($options[$i] != "F" || $options[$i] != "D") then
goto USAGE
endif
@ i++
end
In above code I am looking for F and D and if not found than script goes to USAGE defined somewhere in script. I know it can be done with awk/sed/grep as one liner which I think more efficient. I am new to this and want to move away from doing things in an ancient way. Please help.
Thanks in advance
We have the following statement working in CGYWIN, but when we move the program to Solaris 10 it fails.
x=`echo "ABC196925XYZ" | grep -o --only-matching "\{6\}"`
How can we use AWK or SED to extract only the number from the string?
The following outputs the entire string. We only want... (5 Replies)
Hi friends,
Could you please help me to resolve the below issue.
Input file :-
<Node>
<username>abc</username>
<password>ABC</password>
<Node>
<Node>
<username>xyz</username>
<password>XYZ</password>
<Node>
<Node>
<username>mnp</username>
... (3 Replies)
Hi,
I want to search for patterns (from a file) in a file and print the line matching the patterns and the line before it.
I have to search for 100s of patterns from a file.
Any help with AWK or Sed.
Thanks! (2 Replies)
Thanks for giving your time and effort to answer questions and helping newbies like me understand awk.
I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk.
Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Hello All,
I have a file which is having below type of data,
Jul 19 2011 | 123456
Jul 19 2011 | 123456
Jul 20 2011 | 123456
Jul 20 2011 | 123456
Here I wanted to grep for date pattern as below, so that it should only grep "Jul 20" OR "Jul ... (9 Replies)
Hi, I'm writing a ksh script and trying to use an awk / sed / or perl one-liner to remove the last 4 characters of a line in a file if it begins with a period.
Here is the contents of the file... the column in which I want to remove the last 4 characters is the last column. ($6 in awk). I've... (10 Replies)
Hi,
I need a help to search a pattern and print the multiple lines between them.
Input file:
Tue May 29 12:30:33 EDT 2012:threadWebContainer : 357:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelCancelReservation request: ... (4 Replies)
Hi ,
I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows.
# diff mir_lex.c.modified mir_lex.c.orig
3209c3209
< if(yy_current_buffer -> yy_is_our_buffer == 0) {
---
>... (5 Replies)
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
LEARN ABOUT HPUX
wmemset
wmemory(3C)wmemory(3C)NAME
wmemchr(), wmemcmp(), wmemcpy(), wmemmove(), wmemset() - memory operations based on wide-character
SYNOPSIS DESCRIPTION
These functions operate as efficiently as possible on memory areas (arrays of wide-characters bounded by a count, not terminated by a null
wide-character). They do not check for the overflow of any receiving memory area.
These functions are not affected by locale and all values are treated identically. The null wide-character and values not corresponding to
valid characters are not treated specially.
The function locates the first occurrence of wc in the initial n wide-characters of the object pointed to by ws. The function
returns a pointer to the located wide-character or a null pointer if the wide-character does not occur in the object.
The function compares the first n wide-characters of the object pointed to by ws1 to the first n wide-characters of the object
pointed to by ws2. The function returns an integer greater than, equal to, or less than zero, accordingly as the object
pointed to by ws1 is greater than, equal to, or less than the object pointed to by ws2.
The function copies n wide-characters from the object pointed to by ws2 to the object pointed to by ws1. The null wide-charac-
ter and values not corresponding to valid characters are not treated specially. The function returns the value of ws1.
The function copies n wide-characters from the object pointed to by ws2 to the object pointed to by ws1. Copying takes place as
if the n wide-characters from the object pointed to by ws2 are first copied into a temporary array of n wide-characters that
does not overlap the objects pointed to by ws1 or ws2, and then the n wide-characters from the temporary array are copied
into the object pointed to by ws1. The function returns the value of ws1.
The function copies the value of wc into each of the first n wide-characters of the object pointed to by ws. The function
returns the value of ws.
APPLICATION USAGE
The prototypes of these functions are available to applications if they are:
a. conformant.
b. Compiled with macro with a value >= 500.
c. Compiled with macro with a value >= 200112.
ERRORS
No errors are defined.
AUTHOR
were developed by HP and Mitsubishi Electric Corp.
SEE ALSO thread_safety(5), glossary(9).
wmemory(3C)