04-23-2013
Any chance that's a homework problem?
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I have a flat file like
10 steven
25 mike
47 Charles
127 Nancy
34 steven
23 mike
67 Charles
7761 Nancy
8 steven
54 mike
88 Charles
1267 Nancy
I need to calculate the total of steven and all the members , for this I am using like
grep "`sed -n 1p patterns.txt`"... (7 Replies)
Discussion started by: senthilkumar_ak
7 Replies
2. Shell Programming and Scripting
Hi
First field is the Record Type. A Record Type 5 can have multiple Record Type 6's before another Record Type 5 appears.
I want to calculate the total of fields at position 8-11 on Record type 6 when Record Type 5 has a field at position 11-14 equals to '2222'. then it should delete the lines... (2 Replies)
Discussion started by: appsguy616
2 Replies
3. Shell Programming and Scripting
The file content is dynamic and using this format:
name1 number1
name2 number2
name3 number3
name4 number4
....................
Need a smooth way to calculate the sum of all the numbers in that file (number1 + number2 + number3 + number4........ = total ) (11 Replies)
Discussion started by: TehOne
11 Replies
4. Shell Programming and Scripting
Good afternoon! Im new at scripting and Im trying to write a script to
calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies
5. UNIX for Dummies Questions & Answers
Hi,
For each row in a file, i would like to identify the maximum value and calculate the percentage/fraction of the max for other values in the row.
Then, I would like to print a copy of the file where values above a threshold are replaced with "1" and other values are left as "0".
In the... (2 Replies)
Discussion started by: auburn
2 Replies
6. Shell Programming and Scripting
Hi,
Just wondering, is there anyway I can get the total of logs generated by hours ? Let say I have these logs,
Sep 23 04:48:43 hsbcufs: NOTICE: realloccg /: file system full
Sep 23 04:48:47 hsbcufs: NOTICE: alloc: /: file system full
Sep 23 04:48:51 hsbcufs: NOTICE: realloccg /: file... (14 Replies)
Discussion started by: dehetoxic
14 Replies
7. Shell Programming and Scripting
Hi All ,
I have the following script as below , I tried to modify to meet the requirement , could someone help ? very thanks
================================================================================================
while read STR NAME; do
Total=0
MyString="$STR"
GetData () {... (18 Replies)
Discussion started by: ust3
18 Replies
8. Shell Programming and Scripting
Hi
I am trying to calculate memory used by Linux System
free -m
total used free shared buffers cached
Mem: 32109 31010 1099 0 3600 7287
-/+ buffers/cache: 20121 11987
Swap: 10239 1282 8957
Now according to my requirement Im calculating memory using below cmd
free -m | awk 'NR==3{printf... (2 Replies)
Discussion started by: sam@sam
2 Replies
9. Solaris
Hi,
I want to get total number of cores on my all non-global zones on Solaris 10. I got two methods and both are giving different results. Below link is a script, which tells me that total cores are 8
Mandalika's scratchpad: Oracle Solaris: Show Me the CPU, vCPU, Core Counts and the... (4 Replies)
Discussion started by: ron323232
4 Replies
LEARN ABOUT FREEBSD
g_wither_geom
G_WITHER_GEOM(9) BSD Kernel Developer's Manual G_WITHER_GEOM(9)
NAME
g_wither_geom -- destroy geom and related providers and consumers when you get a chance
SYNOPSIS
#include <geom/geom.h>
void
g_wither_geom(struct g_geom *gp, int error);
DESCRIPTION
The g_wither_geom() function tells GEOM that geom gp is to be destroyed. GEOM sets an error on each provider of the given geom (in the
orphaning process) and waits for a chance to destroy the geom. If the access count of any possessed consumer goes to 0, the consumer will be
detached and destroyed automatically. If the last consumer attached to any possessed provider will be detached, the provider will be
destroyed. If there are no more providers nor consumers, the geom will be destroyed.
This is an automatic ``garbage collect'' to avoid duplicated code in all classes. Before it is called, field softc should be disposed of and
set to NULL. Note that the g_wither_geom() function gives no guarantee that the geom will be immediately destroyed, mostly because the
access counts of the geom's consumers and providers may not be 0. That is why calling this function for every geom from a given class is not
enough to be sure that the class can be unloaded.
RESTRICTIONS
/CONDITIONS
The argument error must be nonzero.
The topology lock has to be held.
SEE ALSO
geom(4), DECLARE_GEOM_CLASS(9), g_access(9), g_attach(9), g_bio(9), g_consumer(9), g_data(9), g_event(9), g_geom(9), g_provider(9),
g_provider_by_name(9)
AUTHORS
This manual page was written by Pawel Jakub Dawidek <pjd@FreeBSD.org>.
BSD
January 16, 2004 BSD