02-26-2003
Thanks for your suggestion. I did the character count as you've recommended and the number matched (comes back as expected).
before cut:
50
38
78
after cut:
28
18
78
I even copied and pasted the expected text to compare and it still would not match up...
I figure I'll just grep for the messages line by line and if it exist set a flag to 'y' for each line and at the end do the if 'y' && 'y' && 'y' check...seems lame but this seems to be my only option...it still bugs me that I have to do this versus my original plan so if anyone can figure it out I'd appreciate it.
Have you tried to create a file with, say 10 lines, and then do the cutting like I did and compare cut lines to expected message?? I'd be interested in seeing what others get. If I don't cut (last line), script finished fine, if I cut/trim a line then the cut lines never pass.
Gianni
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Is there any limitation on the no of characters to be compared using the if statement in Unix. We had an issue while comparing the following two nos.
var1=20051031222900 & var2=20051101003545. The last six dgits are the time stamp for a day.
The if statement is like this:
if
then
move... (8 Replies)
Discussion started by: ranj@chn
8 Replies
2. Shell Programming and Scripting
hi ,
i am trying to compre two strings
if ] or if ]
when the length of var1 is small (around 300-400 char ) it works fine
but when it is large (around 900-1000 chars) it fails
is there any limitations for this type of comparison ??? (3 Replies)
Discussion started by: amarnath
3 Replies
3. AIX
hi ,
i am trying to compre two strings
if ] or if ]
when the length of var1 is small (around 300-400 char ) it works fine
but when it is large (around 900-1000 chars) it fails
is there any limitations for this type of comparison ??? (1 Reply)
Discussion started by: amarnath
1 Replies
4. Shell Programming and Scripting
Hello,
was just wondering how to compare strings in unix? I mean as in C there is a function strcmp() in string.h, is there any function in unix for that? I tried using
if
and all such variations but didn't succeed. Any help would be appreciated. Thanks in advance :) (9 Replies)
Discussion started by: salman4u
9 Replies
5. Shell Programming and Scripting
Another frustrating scripting problem from a biologist trying to manipulate a file with several millions line. For each of the line I need to compare the uppercase A or C or G or T with the lowercase a or c or g or t. If there are more uppercases, a + should be added to a new column, otherwise a -... (10 Replies)
Discussion started by: ivpz
10 Replies
6. UNIX for Dummies Questions & Answers
This might be a dummy question, but is there a command in UNIX that compare two strings character-by-character and display the difference?
---------- Post updated at 11:25 AM ---------- Previous update was at 10:32 AM ----------
Or probably what I'm looking is how to break a string into... (3 Replies)
Discussion started by: Orbix
3 Replies
7. Shell Programming and Scripting
Hi,
can someone please help me!!! urgent!
I have a strange issue here. I grep for 2 strings from a txt files and compare the string value. Though the string values are the same, they are compared as different values. Please help
Case-1
--------
Here I grep for 2 different field values... (3 Replies)
Discussion started by: vani123
3 Replies
8. Shell Programming and Scripting
Hi friend,
i have the following problem:
when i am writting the below command on the command prompt , its working.
while read -n 1 ch; do echo "$ch" ; echo "$ch" ; done<file_name.out.
but when i am executing it after saving it in a ksh file, its not working.
Please helppppppppp .. thankss... (18 Replies)
Discussion started by: neelmani
18 Replies
9. Shell Programming and Scripting
Hi,
I've tried searching through the forum but I've drawn a blank so i'm going to post here. I'm developing a number of checks on a CSV file, trying to find if any are greater than a max limit. I'm testing it by running it from a command line.
The file I'm testing has 8 records. When I... (3 Replies)
Discussion started by: Tmart
3 Replies
10. Shell Programming and Scripting
guys , i am using inotify for monitoring one directory to check core file generation , my snippet of code is follows
#!/bin/bash
DIR=$1
inotifywait -q -e create -m $DIR | while read path events name;
do
if ]; then
echo "Now I am going to do something with $name in directory $path."... (5 Replies)
Discussion started by: baker
5 Replies
IGAWK(1) Utility Commands IGAWK(1)
NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO
gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)