Sponsored Content
Top Forums Shell Programming and Scripting Find highest records in table Post 302828523 by GDC on Tuesday 2nd of July 2013 03:42:56 PM
Old 07-02-2013
Dear Yoda,

thank you very much for your help. I am not quite sure if I understand your awk script. Would you please explain me the use of "if ( $1 in A )"?

Thanks again,
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find the highest number in the file

Hi, I have a file a.txt and it has values in it Eg :- I need to read through the file and find the number that is the greatest in them all. Can any one assit me on this. Thanks (30 Replies)
Discussion started by: systemali
30 Replies

2. Shell Programming and Scripting

Inserting records from flat file to db table

I have 20000 numbers present in a file in each line like 25663, 65465, 74579, 56446, .. .. I have created a table in db with single number column in it. create table testhari (no number(9)); I want to insert all these numbers into that table. how can i do it? can anybody please... (4 Replies)
Discussion started by: Hara
4 Replies

3. Shell Programming and Scripting

How do I load records from table to a flat file!

Hi All, I need to load records from oracle table XYZ to a flat file say ABC.dat. could any one tell me how do i do this in UNXI, Regards Ann (1 Reply)
Discussion started by: Haque123
1 Replies

4. Shell Programming and Scripting

Verifying table records

Hi, Script copies records of two tables into another tables for backup before using oracle's import utility to restore from backup. Now, suppose if the import utility fails then the script will again copy those records from the backup table to the original ones. How to check whether all... (2 Replies)
Discussion started by: milink
2 Replies

5. Shell Programming and Scripting

Total records in table

Hi, I am having two tables. A & B I want to know the total number of records in each table and need to store each value in some variables to process further in the code. How it can be done ? With Regards (2 Replies)
Discussion started by: milink
2 Replies

6. Programming

Help with find highest and smallest number in a file with c

Input file: #data_1 AGDG #data_2 ADG #data_3 ASDDG DG #data_4 A Desired result: Highest 7 Slowest 1 code that I try but failed to archive my goal :( #include <stdio.h> (2 Replies)
Discussion started by: cpp_beginner
2 Replies

7. Shell Programming and Scripting

Getting number of records from a table

I am doing a loading process. I am loading data from a Oracle source to Oracle target. For example there is an SQL statement: Insert into emp_1 Select * from emp_2 where deptno=20; In this case my source is emp_2 and loading into my target table emp_1. This process is automated. Now I... (3 Replies)
Discussion started by: karthikkasarla
3 Replies

8. Shell Programming and Scripting

Find highest number - working but need help!

Hello all, I am new to this and need some help or maybe steer me to the right direction! I wrote a script to get the highest number and prints it on the screen, the script basically asks the user to input numbers, and then prints the highest number! very simple it works like this $sh max.sh... (8 Replies)
Discussion started by: unknownsolo
8 Replies

9. Shell Programming and Scripting

Delete the records from table

Hi, Can any one help me... the records are not deleting when I run the below script. But if I issue the same delete command manually, the records are getting deleted. script: #!/bin/ksh USAGE_STRING="USAGE $0 " if then echo "SORRY you need to be user 'mqm'. Only 'mqm' has... (5 Replies)
Discussion started by: zxcjggu708
5 Replies

10. Solaris

Find highest value of a particular property in multiple files

I have multiple files with pattern of "*.tps (example:tps-20170307170421560-1053.tps)" in my log directory(files are in different sub directories). entries in files are given below. I want to extract highest value of endtime accross all files. "endTime :1488902691462" ... (7 Replies)
Discussion started by: Agoyals1986
7 Replies
ENVSYS.CONF(5)						      BSD File Formats Manual						    ENVSYS.CONF(5)

NAME
envsys.conf -- configuration file for the envsys(4) framework SYNOPSIS
envstat [-S] [-c /etc/envsys.conf] DESCRIPTION
The envsys.conf file configures all the features provided by the envsys(4) framework. It consists of a series of device and sensor blocks. Each sensor block defines a group of properties. The file format is free-form: new line markers and indentation are ignored. Comments start with a '#' sign and extend until the end of line. A property is like a variable assignment. It has a name, which goes to the left of the equal sign, and a value, which goes to the right. The assignment ends with a semicolon. It looks like: name = value; There is no difference between string or integer values when defining them. The value must be surrounded by double quotes if it contains whitespace. There can be multiple groups of devices and multiple groups of sensors in the configuration file. A device block consists of one or more sensor blocks and one or more global properties. It has the following syntax: device_name { prop = value; ... sensor0 { prop = value; ... } ... sensorN { prop = value; ... } } ... Device names are those shown by the 'envstat -D' command; sensor blocks are named by the index position in which they are shown. For example, if we have the following output from the envstat(8) command: CPU Temperature: 32.000 degC MB Temperature: 37.000 degC Vcore Voltage: 1.232 V +3.3 Voltage: 3.248 V +5 Voltage: 4.992 V +12 Voltage: 11.985 V CPU FAN Speed: 1250 RPM 'sensor0' corresponds to the CPU Temperature sensor and 'sensor6' corresponds to the CPU FAN Speed sensor. There is another way that will give you the correct index sensor; the 'envstat -x' command will print the raw XML property list. You only have to find the index object in the appropriate dictionary. The object will be shown as: <key>index</key> <string>sensor2</string> Invalid sensors and devices will be detected by the envstat(8) parser and will be reported as errors. The following properties are provided for sensor blocks (please note that not all properties apply to all type of sensors): critical-capacity = 10; Sets a critical capacity limit property of 10 percent in a battery sensor. Battery sensors are those that report a percentage from the envstat(8) output. It is possible to find out if the sensor accepts this property by running 'envstat -x' and looking if the want-percentage object is defined as true on its dictionary. For example: <key>want-percentage</key> <true/> Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a critical-capacity event will be sent to the powerd(8) daemon (if running) and will execute the block for this event in /etc/powerd/scripts/sensor_battery. If this property is set, its value will be shown in the envstat(8) display output with a column named CritMin. warning-capacity = 20; Sets a warning capacity limit property of 20 percent in a battery sensor. Battery sensors are those that report a percentage from the envstat(8) output. It is possible to find out if the sensor accepts this property by running 'envstat -x' and looking if the want-percentage object is defined as true on its dictionary. For example: <key>want-percentage</key> <true/> Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a warning-capacity event will be sent to the powerd(8) daemon (if running) and will execute the block for this event in /etc/powerd/scripts/sensor_battery. If this property is set, its value will be shown in the envstat(8) display output with a column named WarnMin. high-capacity = 90; Sets a high capacity limit property of 90 percent in a battery sensor. Battery sensors are those that report a percentage from the envstat(8) output. It is possible to find out if the sensor accepts this property by running 'envstat -x' and looking if the want-percentage object is defined as true on its dictionary. For example: <key>want-percentage</key> <true/> Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a high-capacity event will be sent to the powerd(8) daemon (if running) and will execute the block for this event in /etc/powerd/scripts/sensor_battery. If this property is set, its value will be shown in the envstat(8) display output with a column named WarnMax. maximum-capacity = 99; Sets a warning capacity limit property of 99 percent in a battery sensor. Battery sensors are those that report a percentage from the envstat(8) output. It is possible to find out if the sensor accepts this property by running 'envstat -x' and looking if the want-percentage object is defined as true on its dictionary. For example: <key>want-percentage</key> <true/> Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a warning-capacity event will be sent to the powerd(8) daemon (if running) and will execute the block for this event in /etc/powerd/scripts/sensor_battery. If this property is set, its value will be shown in the envstat(8) display output with a column named WarnMin. critical-max = 70C; Sets a critical maximum limit property in a sensor. Note that in this example, we are specifying the 'C' keyword at the end; that means that this will only be valid for temperature sensors and that the value is specified as degrees Celsius. If degrees Fahrenheit are wanted, just use the letter F, as in: critical-max = 140F; To know sensor type, you have to look at the type object in the XML property list. Remember: the XML property list has all the infor- mation that the application uses to print the values! Other sensors that are not of temperature type must not include the final character for the unit. A dot is allowed in the value, if it corresponds to the range that the sensor is reporting. When the limit has been reached in the sensor, a critical-over event will be sent to the powerd(8) daemon (if running) and will execute the block for this event in the appropriate /etc/powerd/scripts/sensor_foo script (depending on the sensor's type). Please note that this property cannot be set in battery capacity sensors (those that have the want-percentage object in their dictio- nary). This rule applies for the 'critical-min', 'warning-max', and 'warning-min' properties too. If this property is set, its value will be shown in the envstat(8) display output with a column named CritMax. critical-min = 1.230; Sets a critical minimum limit property in a sensor. The rules for critical-max, critical-min, warning-max, and warning-min are the same. When the limit has been reached in the sensor, a critical-under event will be sent to the powerd(8) daemon (if running) and will execute the block for this event in the appropriate /etc/powerd/scripts/sensor_foo script (depending on the sensor's type). If this property is set, its value will be shown in the envstat(8) display output with a column named CritMin. warning-max = 70C; Sets a warning maximum limit property in a sensor. The rules for critical-max, critical-min, warning-max, and warning-min are the same. When the limit has been reached in the sensor, a warning-over event will be sent to the powerd(8) daemon (if running) and will execute the block for this event in the appropriate /etc/powerd/scripts/sensor_foo script (depending on the sensor's type). Please note that this property cannot be set in battery capacity sensors (those that have the want-percentage object in their dictio- nary). This rule applies for the 'warning-min' property too. If this property is set, its value will be shown in the envstat(8) display output with a column named WarnMax. warning-min = 1.230; Sets a critical minimum limit property in a sensor. The rules for critical-max, critical-min, warning-max, and warning-min are the same. When the limit has been reached in the sensor, a warning-under event will be sent to the powerd(8) daemon (if running) and will execute the block for this event in the appropriate /etc/powerd/scripts/sensor_foo script (depending on the sensor's type). If this property is set, its value will be shown in the envstat(8) display output with a column named WarnMin. description = string Sets a new description in a sensor. You can set this property in all sensors, except that you won't be able to set a description that is currently used for the specified device. rfact = 56000 Sets a new resistor factor property in a sensor. This property is only allowed in Voltage sensors and only if the device has enabled the appropriate flag for the mentioned sensor. The resistor factor may be used to change the behavior of the value returned by the device. If a sensor supports this, the allow-rfact object appears enabled (true) in the dictionary. The following properties are available for device blocks: refresh-timeout = 10s This property sets the refresh timeout value in a device, and will be used to refresh data and check for critical conditions any time the timeout is met. The value may be specified in seconds, minutes or hours. To specify the value in seconds, the s character must be appended last, if minutes is desired, a m and a h for hours. For example 10s for 10 seconds or 1h for one hour. FILES
/etc/envsys.conf Default configuration file. SEE ALSO
proplib(3), envsys(4), envstat(8), powerd(8) HISTORY
The envsys.conf configuration file first appeared in NetBSD 5.0. BSD
February 15, 2010 BSD
All times are GMT -4. The time now is 02:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy