Sponsored Content
Full Discussion: Processes
Top Forums Shell Programming and Scripting Processes Post 302104432 by anbu23 on Thursday 25th of January 2007 06:32:27 AM
Old 01-25-2007
Quote:
Originally Posted by Krrishv
Anbu, it's throwing me error.

crypto $ awk ' { tm=$4; sub("s","",tm); if( tm > 200000 ) print } 'procs.txt
syntax error The source line is 1.
The error context is
{ tm=$4; sub("s","",tm); if( tm > 200000 ) print } >>> procs. <<< txt
awk: Quitting
The source line is 1.

Also Please let me know how to print if the users column is null.
Your first line of the file causes the problem
Code:
No. State Query Times User Processed Syslog

Code:
awk ' NR > 1  { tm=$4; sub("s","",tm); if( tm > 200000 ) print } 'procs.txt

If you are sure that only the user field contains null then try this
Code:
awk ' NF < 7 ' file

or you try this
Code:
awk ' $0 !~ "[0-9]+s [^ ]+ [0-9]+" ' file


Last edited by anbu23; 01-25-2007 at 07:50 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

co-processes

Is it possible to have a main script (i will call it main.ksh) that executes say, 4 other scripts (sub_prog_1.ksh, sub_prog_2.ksh etc..) from within this main.ksh (simultaneously/in parallel), have them run in the background and communicate back to main.ksh when complete? My guess is to use... (1 Reply)
Discussion started by: google
1 Replies

2. UNIX for Dummies Questions & Answers

processes

What command string will locate ONLY the PID of a process and ouput only the number of PID of the process? (1 Reply)
Discussion started by: mma_buc_98
1 Replies

3. Shell Programming and Scripting

I need some example of Co-Processes

I want to know how to work the Co-Processes in kornshell scripts. So, I very need some script about Co-Processes! thanks ...:) (3 Replies)
Discussion started by: javalee
3 Replies

4. Filesystems, Disks and Memory

processes

write a program create two processes to run a for loop which adds numbers 1 to n , say one process adds odd numbers and other adds even numbers (1 Reply)
Discussion started by: jayaram_miryabb
1 Replies

5. UNIX for Dummies Questions & Answers

Processes

Can someone tell how to find out how long a process has been running? I want to find something that is usually there that the paging system can check on. Thanks (4 Replies)
Discussion started by: Beetlejuice
4 Replies

6. UNIX for Advanced & Expert Users

Monitoring Processes - Killing hung processes

Is there a way to monitor certain processes and if they hang too long to kill them, but certain scripts which are expected to take a long time to let them go? Thank you Richard (4 Replies)
Discussion started by: ukndoit
4 Replies

7. Solaris

Identifying and grouping OS processes and APP processes

Hi Is there an easy way to identify and group currently running processes into OS processes and APP processes. Not all applications are installed as packages. Any free tools or scripts to do this? Many thanks. (2 Replies)
Discussion started by: wilsonee
2 Replies

8. UNIX for Dummies Questions & Answers

Processes

Hi all, I needed a little help. It's OS thing. Suppose I have 2 machine connect over a network, I will call my machines as M1and M2. If I copy a files from M1 to M2. What tasks are these two machine performing for copy to work. My assumption is that M1 is performing read action and... (1 Reply)
Discussion started by: vishwesh
1 Replies

9. Shell Programming and Scripting

Finding the age of a unix process, killing old processes, killing zombie processes

I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time. Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies

10. UNIX for Dummies Questions & Answers

processes

may i know a command to find processes not attached to a terminal?? (1 Reply)
Discussion started by: riya9
1 Replies
glutIdleFunc(3GLUT)						       GLUT						       glutIdleFunc(3GLUT)

NAME
glutIdleFunc - sets the global idle callback. SYNTAX
void glutIdleFunc(void (*func)(void)); ARGUMENTS
func The new idle callback function. DESCRIPTION
glutIdleFunc sets the global idle callback to be func so a GLUT program can perform background processing tasks or continuous animation when window system events are not being received. If enabled, the idle callback is continuously called when events are not being received. The callback routine has no parameters. The current window and current menu will not be changed before the idle callback. Programs with multiple windows and/or menus should explicitly set the current window and/or current menu and not rely on its current setting. The amount of computation and rendering done in an idle callback should be minimized to avoid affecting the program's interactive response. In general, not more than a single frame of rendering should be done in an idle callback. Passing NULL to glutIdleFunc disables the generation of the idle callback. EXAMPLE
A typical idle callback to animate a window might look like: void idle(void) { time += 0.05; glutSetWindow(window); glutPostRedisplay(); } Notice how the idle callback does not do any actual drawing; it only advances the time scene state global variable. That is left to the window's display callback which will be triggered by the call to glutPostRedisplay. If you use the idle callback for animation, you should be sure to stop rendering when the window is not visible. This is easy to set up with a visibility callback. For example: void visible(int vis) { if (vis == GLUT_VISIBLE) glutIdleFunc(idle); else glutIdleFunc(NULL); } If you do use the idle callback for animation, one thing you should not do is setup the idle callback before calling glutMainLoop. It is much better to use the visibility callback to install idle callback when the window first becomes visible on the screen. SEE ALSO
glutTimerFunc, glutVisibilityFunc AUTHOR
Mark J. Kilgard (mjk@nvidia.com) GLUT
3.7 glutIdleFunc(3GLUT)
All times are GMT -4. The time now is 11:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy