Sponsored Content
Top Forums Shell Programming and Scripting how to make percentage of a running script? Post 97554 by vgersh99 on Tuesday 31st of January 2006 01:41:41 PM
Old 01-31-2006
look into this link
 

10 More Discussions You Might Find Interesting

1. Programming

Error when running make

Hi , I get the following error when i run the make command. cc -Aa -DUNIX -osrcmpmn srcmpmn.c crt0: ERROR couldn't open /usr/lib/dld.sl errno:000000014 *** Error exit code 14 here the file is C program which has been modified. Please help. (1 Reply)
Discussion started by: shashidhara_01
1 Replies

2. Programming

Error while running C++ make file

The problem is that the original program was compiled using v5.0 MQ client but now we are using MQ client v5.3. Had modified the "make file" options as follows but still i could see the errors. #CLIENT_V5_LIBS = -limqb23ss -limqc23ss -lmqic -lmqmcs -lnsl -ldl CLIENT_V5.3_LIBS =... (1 Reply)
Discussion started by: hram
1 Replies

3. Shell Programming and Scripting

Need an AWK script to calculate the percentage

Hi I need a awk script to calculate percentage. I have to pass the pararmeters in to the awk script and calculate the percentage. Sum = 50 passed = 43 failed = 7 I need to pass these value in to the awk script and calculate the percentage. Please advice me. (8 Replies)
Discussion started by: bobprabhu
8 Replies

4. Shell Programming and Scripting

Help with bash script - Need to get CPU usage as a percentage

I'm writing a bash script to log some selections from a sensors output (core temp, mb temp, etc.) and I would also like to have the current cpu usage as a percentage. I have no idea how to go about getting it in a form that a bash script can use. For example, I would simply look in the output of... (3 Replies)
Discussion started by: graysky
3 Replies

5. Shell Programming and Scripting

Script shell, how to calculate percentage?

hello, please can you help me. jj and kk are two numbers which are the result of an sql program. I would like to calculate the ratio jj/kk*100. I have done this: ratio=$((jj/kk * 100)) or ratio=`expr $jj \/ expr $kk) but the result is 0 What can i do? Thanks for help. (3 Replies)
Discussion started by: likeaix
3 Replies

6. Programming

Shell script to find Percentage?

Hi all, I havea log of data.log bear,10000,white bear,5000,black chicken,2000,white chicken,4000,yellow chicken,3000,black lion,6000,yellow lion,1000,white How can we have shell script to get the percentage of each animals? Thanks. (8 Replies)
Discussion started by: sabercats
8 Replies

7. Shell Programming and Scripting

Make a job always running.

Hi All, i want to make a job as always running job so that whenever it recieve a input file the job should process the file. Please help me with this. (3 Replies)
Discussion started by: mahesh300182
3 Replies

8. UNIX for Dummies Questions & Answers

Percentage / Multiplication in Shell Script

Hello, I am trying to compute the percentage in a script as shown below: PerCover=`echo "scale=2 ; 100 \* ($InputCover/$Total)" | bc` However the PerCover value is blank/null. What do I need to do differently? Thanks for your input! ~Guss (1 Reply)
Discussion started by: Gussifinknottle
1 Replies

9. UNIX for Beginners Questions & Answers

Working out percentage in shell script

Hi All, I currently have a shell script which is pulling multiple counters from various sources. Due to the counters being cumulative counters I've got some code to work out the delta from the last reading and current which is working fine. The problem i have now is being able to work out the... (8 Replies)
Discussion started by: mutley2202
8 Replies

10. HP-UX

Shell /awk script for Percentage

having two columns, A and B.. i need to add another column C in a file and calculate the percentage based on the column A and B. (COLUMN B/ COLUMN A *100) . "|" is delimiter separating the A and B.. need C column with the percentage value. Thanks for your help 100|50 |50% ... (6 Replies)
Discussion started by: kartikirans
6 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 05:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy