I am practising awk and decided to compare two columns and print the result of the comparison as third column
i/p data
i am trying to compare the last two columns and if they match I am trying to print match else mismatch(Ideally i want that as a last column in the same file
expected output
but all I am getting is
or if just say awk'{print $NF}
I am getting the output as
same out put even if i use $(NF-1)
I also tried commenting the awk -v var=$a '{BEGIN s=a}{print $0,s} line in my code and ran it
the output i get is
But i Read $NF returns the last column and NF-1 returns the last but one column.
Hi,
I have a script in which an entry like this .....
FILENAME_B="PIC_${DATE}0732*.JPG"
The script connects to an ATM and pull a pic file from it.The format for the file is like PIC_2008061400000001.JPG in the ATM.
Means 1st 8 digit is the date(YYYYMMDD) field
2nd 8 digit means hrs... (2 Replies)
Hi All,
i have a file which have many fields delimited by ,(comma)
now i have to show only few fields and not all.
the sample text file looks like this:
TYPE=SERVICEEVENT, TIMESTAMP=05/06/2009 11:01:40 PM, HOST=sppwa634, APPLICATION=ASComp, FUNCTION=LimitsService, SOU... (8 Replies)
i have a line like this in my script
IP=`get_IP <hostname> | awk '{ print $1 }'
echo $IP
the problem is get_IP <hostname> returns data formated as follows:
ip 1.1.1.1 name server_name
the code above returns
1.1.1.1 server_name and i just need the 1.1.1.1
I have tried to add "|... (5 Replies)
Hi,
I am presently stuck in a csv file.
INPUT CSV
baseball,NULL,8798765,Most played
baseball,NULL,8928192,Most played
baseball,NULL,5678945,Most played
cricket,NOTNULL,125782,Usually played
cricket,NOTNULL,678921,Usually played
EXPECTED OUTPUT CSV
... (7 Replies)
Hello Everyone,
One of our servers is showing a strange issue, let me paste the output
root # uptime
4:37pm 3 users, load average: 0.00, 0.04, 0.04
Its been running since months but you can see after time there isn't any output like up 191 days(s).
Even the who command with b... (1 Reply)
I have five classes. 2 composition classes,1 aggregation class and 1 dependency class.I have coded all the classes but one of my test program is not giving me the expected result.I have the following classes:
TimeStamp
Interval (composition of 2 TimeStamps)
TimeSheet ( aggregation of many... (3 Replies)
Hi
I am getting below output when I run lsrsrc IBM.ManagementServer
sbkpshrasd02# lsrsrc "IBM.ManagementServer"
Resource Persistent Attributes for IBM.ManagementServer
I started the ctcas service but still no use. Stopped and started RMC. Any ideas what needs to be done.
----------... (1 Reply)
Version: RHEL 5.8
I am doing a grep of the piped output from ps command as shown below.
I am grepping for the pattern ora_dbw* . But, in the result set I am seeing strings with ora_dbr* as well like ora_dbrm_SDLM1DAS3 as shown below. Any idea why is this happening ?
$ ps -ef | grep... (6 Replies)
Good Moring,
I am currently reading about awk in a manual and following the examples using the oratab file.
My system is SOLARIS 10
I think I am getting strange behavior judging by what the book says to do and what I am getting with my little program.
Here is my program:
grep -v oratab |... (4 Replies)