Hey gang, I have a list of times I need to sum up. This list can vary from a few to a few thousand entries. Now I had found a closed reference to adding time titled "add up time with xx:yy format in bash how?" In it, the example works great for that formatted list of times... This is the reply code from user AGAMA in that thread:
"
BUT what I'm getting hung up on is how would I introduce the third parameter of seconds to this, if my times had the three columns?
I'm not quite verse enough in scripting to understand the formatting of the read in the 'do' loop. Are the '%' and '#' arbitrary or necessary for what they're representing?
In the other thread Agama tries to explain parameter expansion in a latter reply, but try as I may, I'm not wrapping my shrunken brain around this. I do need a bit of assistance trying to figure it out and adding in the seconds to tally up.
Hello everyone and let me start off by thanking anyone who can help with this.
I work for a company that uses Unix as one of their servers. I'm not at all familar with Unix beyond logging after I restart the server:rolleyes: I'm looking for some command that will bring me up a list of current... (3 Replies)
Hi all,
I have a list of times:
...10:02
15:34
20:05
01:51
06:55
09:00
05:52...
That's just part of the list (its huge).
How do I go about selecting certain times, e.g. just between 23:00 and 05:00 ?? (4 Replies)
i have a list of numbers like this;
124
235
764
782
765
451
983
909
...
and i want to make a sum with the first 3 of them then the next 3 and so on.
124+235+764=1123
782+765+451=1998
...
some ideas? (4 Replies)
Hi Experts,
I want to add 20% to the values and get an output , please advise with script , awk etc,
# cat datafile.txt
50.4053
278.383
258.164
198.743
4657.66
12.7441
646.787
1.56836
23.2969
191.805
53.3096
1.12988
999.058
4100.29 (2 Replies)
If I had a word list with a large amount of words in it, how would I (using a unix command) add, say, 123 to the end of each word?
EDIT: The word list is stored in a large text file. I need a command that applies the ending to each word in the file and saves the result in a new text file. (7 Replies)
Hello,
i'm trying to implement the times() function and i'm programming in C.
I'm using the "struct tms" structure which consists of the fields:
The tms_utime structure member is the CPU time charged for the execution of user instructions of the calling process.
The tms_stime structure... (1 Reply)
I'm having some troubles setting an instance of postgreSQL to automatically start upon system boot. I have two servers running this app, one is automatically starting the service, the other is not. I'm attempting to use the "svcadmin" command, however, apparently when I run a "svcs -a" search, the... (6 Replies)
Hi All,
I have a file with long list of numbers. This file contains only one column. These numbers are very large. I am using following command:
cat myfile.txt | awk '{ sum+=$1} END {print sum}'
The output is coming in scientific notation. How do I get the result in proper format?
... (4 Replies)
Discussion started by: angshuman
4 Replies
LEARN ABOUT BSD
accton
SA(8) System Manager's Manual SA(8)NAME
sa, accton - system accounting
SYNOPSIS
sa [ -abcdDfijkKlnrstu ] [ -v threshold ] [ -S savacctfile ] [ -U usracctfile ] [ file ]
accton [ file ]
DESCRIPTION
With an argument naming an existing file, accton causes system accounting information for every process executed to be placed at the end of
the file. If no argument is given, accounting is turned off.
Sa reports on, cleans up, and generally maintains accounting files.
Sa is able to condense the information in /usr/adm/acct into a summary file /usr/adm/savacct which contains a count of the number of times
each command was called and the time resources consumed. This condensation is desirable because on a large system /usr/adm/acct can grow
by 100 blocks per day. The summary file is normally read before the accounting file, so the reports include all available information.
If a file name is given as the last argument, that file will be treated as the accounting file; /usr/adm/acct is the default.
Output fields are labeled: "cpu" for the sum of user+system time (in minutes), "re" for real time (also in minutes), "k" for cpu-time aver-
aged core usage (in 1k units), "avio" for average number of i/o operations per execution. With options fields labeled "tio" for total i/o
operations, "k*sec" for cpu storage integral (kilo-core seconds), "u" and "s" for user and system cpu time alone (both in minutes) will
sometimes appear.
There are near a googol of options:
a Print all command names, even those containing unprintable characters and those used only once. By default, those are placed under
the name `***other.'
b Sort output by sum of user and system time divided by number of calls. Default sort is by sum of user and system times.
c Besides total user, system, and real time for each command print percentage of total time over all commands.
d Sort by average number of disk i/o operations.
D Print and sort by total number of disk i/o operations.
f Force no interactive threshold compression with -v flag.
i Don't read in summary file.
j Instead of total minutes time for each category, give seconds per call.
k Sort by cpu-time average memory usage.
K Print and sort by cpu-storage integral.
l Separate system and user time; normally they are combined.
m Print number of processes and number of CPU minutes for each user.
n Sort by number of calls.
r Reverse order of sort.
s Merge accounting file into summary file /usr/adm/savacct when done.
t For each command report ratio of real time to the sum of user and system times.
u Superseding all other flags, print for each command in the accounting file the user ID and command name.
v Followed by a number n, types the name of each command used n times or fewer. Await a reply from the terminal; if it begins with
`y', add the command to the category `**junk**.' This is used to strip out garbage.
S The following filename is used as the command summary file instead of /usr/adm/savacct.
U The following filename is used instead of /usr/adm/usracct to accumulate the per-user statistics printed by the -m option.
FILES
/usr/adm/acct raw accounting
/usr/adm/savacct summary
/usr/adm/usracct per-user summary
SEE ALSO ac(8), acct(2)BUGS
The number of options to this program is absurd.
4th Berkeley Distribution November 16, 1996 SA(8)