473,320 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Getting value automatically.

Hi All,

I need to get $ACTRUN and others value defined here manully by running command like ACTRUN=`cat /tmp/HOSTSTATUS| tail -1 | awk '{print $2}'`;

In short I want to cat file and assign value to all $ACT variables. Any Idea ?

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl -w
  2.  
  3. $ACTRUN=78;
  4. $ACTLIMIT=10;
  5. $ACTFENCE = 0;
  6. $ACTDATE='02/18/08';
  7. $ACTTIME='19:01';
  8. $ACTSTATE='LTI';
  9. $ACTMETHOD=JW;
  10. open(FILE, "</tmp/HOSTSTATUS") || die "cannot open /tmp/HOSTSTATUS : $!\n";
  11. while ($line=<FILE>)
  12. {
  13. chomp($line);
  14. @line=split(' ',$line,11);
  15. #@line{ 'CPUID', 'RUN', 'NODE',  'LIMIT', 'FENCE', 'DATE', 'TIME',  'STATE', 'METHOD', 'DOMAIN' }=@line;
  16.  
  17. ($CPUID,$RUN,$NODE,$FTA,$LIMIT,$FENCE,$DATE,$TIME,$STATE,$METHOD,$DOMAIN)=@line;
  18. #print "$CPUID  $RUN $NODE $LIMIT $FENCE $DATE $TIME $STATE $METHOD $DOMAIN" ,"\n";
  19. print $ACTRUN;
  20. if ( $RUN == $ACTRUN ) {print "";}
  21. else { print "$CPUID is not OK run #";}
  22.  
  23. if ( $LIMIT == $ACTLIMIT ) { print  "";}
  24. else { print "$CPUID has LIMIT Problem \n";}
  25.  
  26. if ( $FENCE  == $ACTFENCE ) {print "";}
  27. else { print "$CPUID has FENCE Problem\n";}
  28.  
  29. if ( $DATE  eq  $ACTDATE ) {print "";}
  30. else { print "$CPUID has DATE Problem\n";}
  31.  
  32. if ( $TIME eq $ACTTIME ) {print "";}
  33. else { print "$CPUID has TIME Problem\n";}
  34.  
  35. if ( ${STATE}  eq ${ACTSTATE} ) {print "";}
  36. else { print "$CPUID has STATE Problem\n";}
  37.  
  38. if ( $METHOD  eq $ACTMETHOD ) {print "";}
  39. else { print "$CPUID has METHOD Problem\n";}
  40.  
  41.  
  42. #SWITCH:  {
  43. #         $RUN != $ACTRUN   { print "$CPUID RUN # ok";};
  44. #         }
  45.  
  46. }
  47. close (FILE);
Feb 25 '08 #1
1 1110
KevinADC
4,059 Expert 2GB
Getting value automatically.

I need to get $ACTRUN and others value defined here manu[a]lly
automatically and manually are mutually exclusive, define what you are trying to do without contradicting yourself and hopefully someone can help.
Feb 25 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this...
9
by: deko | last post by:
What is it with these dates? What are they so much trouble? All I want to do is subtract an hour, but not if that makes dtmTest less than dtmClt. Dim dtmStart As Date Dim dtmEnd As Date Dim...
5
by: Thelma Lubkin | last post by:
I have a form/subform with the common one-to-many relationship. The form allows user to display records and move to other records via the selector, to add,delete, and edit them, with the related...
3
by: Jason L James | last post by:
Hi all, I recently wrote a vb.net app using oledb to an access database. When I inserted new rows in my datatable the identity column was automatically created. This app used an un-typed...
13
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the...
4
by: R.Manikandan | last post by:
Hi In my code, one string variable is subjected to contain more amount of characters. If it cross certain limit, the string content in the varabile is automatically getting truncated and i am...
5
by: rn5a | last post by:
A Web Form has a TextBox within a DataGrid wherein users are expected to enter only whole numbers. It should be validated so that the TextBox doesn't remain blank or any non-numeric data is...
41
by: Jim | last post by:
Hi guys, I have an object which represents an "item" in a CMS "component" where an "item" in the most basic form just a field, and a "component" is effectively a table. "item" objects can be...
3
by: Markw | last post by:
I think this was recently asked but I was a little lost on the example that was used so I'm reasking it with an example I can understand. Also forgive me for such a basic question but I really am...
9
Catalyst159
by: Catalyst159 | last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows: Part A: Maximum FAR and Floor Area: Part B: Gross Floor Area of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.