Obiously, awk is a fairly complete programming language, so you can rewrite simple text-processing utilities in awk, many of them easily.
so, if i read your post correctly, with awk i can simulate sime functions of tail or head...
what about sort?
i must admint my knowledge of awk is fairly simple. i ave seen more complex ones, and im reading this website AWK Language Programming - Table of Contents
readnig the temporal file with awk and doing all the text procesing will decrease the number of binaries that have to be loaded (less i/o)
Quote:
Originally Posted by era
tail is harder to emulate generically because the array type is rather crude. Maybe switch to sed (or Perl!) for that.
well. i see now, that perl is a best solution than bash. after all perl was made to process text right? :P
and perl has always been in my todo-list
the problem there would be to pipe the info to dzen
because the way dzen works, i need an never ending loop, so dzen dosnt die
is posible to do that piping from a perl script?
The first few lines of top output indicate the CPU usage. Read the manual page to learn what the fields mean.
[/quote]
i know that. the problem is getting that info without using head | tail | cut or awk
spawning all those apps 4 times on the same text input file doesnt strike me as good performance
Hi All,
I have a pair of sun ultra 5_10 with SunOS 5.5.1.
Both are almost equally patched and set up with simillar applications.
host# uname -a
SunOS host 5.5.1 Generic_103640-24 sun4u sparc SUNW,Ultra-5_10
Even though both have
same amount of RAM ( 512 Mb ) ,
... (1 Reply)
Hi All,
Kindly help me in optimizing the server as it displays a great amount of CPU & MEM being utilised when the mysql process executes.
Below are the stats ---
--------------------------------------------------------------------------
# top
15:51:57 up 23:22, 5 users, load average:... (1 Reply)
What is amount of free RAM i have now?
total used free shared buffers cached
Mem: 1010 963 46 0 215 256
-/+ buffers/cache: 491 518
Swap: 1983 0 1983
Above is the output of... (1 Reply)
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
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)
Hi all,
Is it possible to get total memory usage and free memory usage without top? By Googling I found for total memory usage, use vmstat, for CPU, use mpstat, for disk I/O use iostat, is this correct? Will using sar gives the same result as ALL of these three (3) commands?
What about if I... (2 Replies)
Hi folks,
I'm a CS students enrolled in a sysadmin class where we've been covering bash scripting for the past few weeks. I have prior knowledge in java, c++, c#, python,and some scripting languages like asp.net w/c# and php. This bash stuff seems pretty neat and a bit different than what I am... (9 Replies)
I do not know shell scripting. But at work place, I have got an in and out shell scripting task. I just need to understand a very big script. Is there any tool in which I can place the script and it can tell me the meaning of the whole script? (3 Replies)