Sponsored Content
Top Forums Shell Programming and Scripting How to check same process running 10 times? Post 303007074 by Kalia on Friday 10th of November 2017 03:36:56 PM
Old 11-10-2017
Thanks a lot for ur quick respond Am runing below script passing 1 because no duplicate job runing now it giving correct output-AIX operating system

my question::Will it work if runing more then 10 time or will it compaire please confirm
Code:
awk '++s[$2]==10'

Code:
jobs=$(ps -u pintu -o pid= -o args=| awk '++s[$2]==1')
if [[ -n "$jobs" ]]
then
  printf "jobs runing longtime:\n%s\n" "$jobs"
  exit 1
fi

see the below output also
Code:
jobs runing longtime:
 2362 /usr/bin/gnome-keyring-daemon --daemonize --login
 2371 gnome-session
 2380 dbus-launch --sh-syntax --exit-with-session
 2381 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
 2399 /usr/libexec/gconfd-2
 2406 /usr/libexec/gnome-settings-daemon
 2408 seahorse-daemon
 2415 /usr/libexec/gvfsd
 2423 metacity
 2434 /usr/bin/pulseaudio --start --log-target=syslog
 2435 gnome-panel
 2440 /usr/libexec/pulse/gconf-helper
 2441 nautilus
 2443 /usr/libexec/bonobo-activation-server --ac-activate --ior-output-fd=18
 2453 /usr/libexec/gvfs-gdu-volume-monitor
 2454 /usr/libexec/wnck-applet --oaf-activate-iid=OAFIID:GNOME_Wncklet_Factory --oaf-ior-fd=18
 2455 /usr/libexec/trashapplet --oaf-activate-iid=OAFIID:GNOME_Panel_TrashApplet_Factory --oaf-ior-fd=24
 2459 /usr/lib/vmware-tools/sbin32/vmtoolsd -n vmusr --blockFd 3
 2467 gpk-update-icon
 2470 gnome-power-manager
 2474 gnome-volume-control-applet
 2476 bluetooth-applet
 2480 /usr/sbin/restorecond -u
 2482 /usr/libexec/polkit-gnome-authentication-agent-1
 2485 python /usr/share/system-config-printer/applet.py
 2486 /usr/libexec/gdu-notification-daemon
 2489 nm-applet --sm-disable
 2494 /usr/libexec/gvfs-afc-volume-monitor
 2498 /usr/libexec/gvfsd-trash --spawner :1.7 /org/gtk/gvfs/exec_spaw/0
 2502 /usr/libexec/gvfs-gphoto2-volume-monitor
 2509 gnome-screensaver
 2518 /usr/bin/gnote --panel-applet --oaf-activate-iid=OAFIID:GnoteApplet_Factory --oaf-ior-fd=23
 2519 /usr/libexec/clock-applet --oaf-activate-iid=OAFIID:GNOME_ClockApplet_Factory --oaf-ior-fd=29
 2520 /usr/libexec/notification-area-applet --oaf-activate-iid=OAFIID:GNOME_NotificationAreaApplet_Factory --oaf-ior-fd=39
 2521 /usr/libexec/gdm-user-switch-applet --oaf-activate-iid=OAFIID:GNOME_FastUserSwitchApplet_Factory --oaf-ior-fd=35
 2562 /usr/libexec/gvfsd-burn --spawner :1.7 /org/gtk/gvfs/exec_spaw/1
 2569 /usr/libexec/gvfsd-metadata
 2575 /usr/bin/gnome-terminal -x /bin/sh -c cd '/home/pintu/Desktop' && exec $SHELL -l
 2576 gnome-pty-helper
 2577 /bin/bash -l
 2843 sh t2.sh
 2845 ps -u pintu -o pid= -o args=
 2846 awk ++s[$2]==1

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

check process running

I have this script: ------------------------------------------------------- #!/bin/ksh # if ] || ] then echo "Executing main_load.sh script" /usr1/psc_load/jobs/cron/main_load.sh "ods" else echo "File not found, do nothing" fi exit 0 ... (4 Replies)
Discussion started by: rose1207
4 Replies

2. Solaris

Check whether ftpd process is running or not?

Hi, I want to check whether the ftpd process is running or not. Is there any solaris command that can help me in this? Or is there any other way in which I can check this? Is it possible to check programmatically (preferrably in a C++ code)? Eagerly awaiting a reply. Thanx. (8 Replies)
Discussion started by: The.White.Rider
8 Replies

3. Shell Programming and Scripting

script to check if process is running

How do I make a shell script to see if a certain process is running. The process shows up on ps aux as /usr/sbin/daemon eg: if /usr/sbin/daemon else #nothin basically i want to run the process if it isnt running/ has been stopped. Thanks. (2 Replies)
Discussion started by: daydreamer
2 Replies

4. UNIX for Advanced & Expert Users

How to check since when (for how long) a particular process is running ?

How do I check if a particular process is running from a certain date and time ? (2 Replies)
Discussion started by: hpuxlxboy
2 Replies

5. Shell Programming and Scripting

Check if Process is running

Hi , I have a csh code below which check the process if it's running. Can any expert advise me on the following: 1) what does this notationmean ">!" and how is it different from the append ">" notation ? 2) how does "setenv" work in this code ? # Check whether there is a running... (3 Replies)
Discussion started by: Raynon
3 Replies

6. UNIX and Linux Applications

How to check if process is running?

Hi I would like to check if an instance of a script is already running. I've seen many different examples, but I haven't the slightest idea as to how to do this. Can you please help. Thank you. (5 Replies)
Discussion started by: ladyAnne
5 Replies

7. Programming

How do I check if a process is running in C

How to I check if a process is running in C? I'm trying to use ps aux |grep "process name" but failing in doing that. How do I do that? Thanks, (1 Reply)
Discussion started by: cprogdude
1 Replies

8. Shell Programming and Scripting

Script to check running of process

Hi, Can anyone please tell me how to write a shell script to check whether a process if running or not.... if its still running then wait for sometime and if not then run the next query. Also, Under my one main script main.sh I have to run 2 scripts simutaneously which take some time to... (2 Replies)
Discussion started by: lovepujain
2 Replies

9. Shell Programming and Scripting

need to check if the process is running

Hi, I check if the process is running or not using the below. /usr/ucb/ps auxww | grep 109 |grep rmi | awk '{print $2}' 9718 Thus we see 9718 is the PID. It return blank if the process is not running. I need to perform some action if the process is not running and leave it if... (8 Replies)
Discussion started by: shifahim
8 Replies

10. UNIX for Dummies Questions & Answers

How a process can check if a particular process is running on different machine?

I have process1 running on one machine and generating some log file. Now another process which can be launched on any machine wants to know if process1 is running or not and also in case it is running it wants to stream the logs file generated by process1 on terminal from which process2 is... (2 Replies)
Discussion started by: saurabhnsit2001
2 Replies
Distccmon-gnome(1)					      General Commands Manual						Distccmon-gnome(1)

NAME
Distccmon-gnome - GTK monitor for distcc a distributed client and server SYNOPSIS
distccmon-gnome [OPTION...] DESCRIPTION
This manual page documents briefly the Distccmon-gnome commands. OPTIONS
This version of distccmon-gnome understands the following command line options: --load-modules=MODULE1,MODULE2,... Dynamic modules to load -?, --help Show this help message --usage Display brief usage message --gdk-debug=FLAGS Gdk debugging flags to set --gdk-no-debug=FLAGS Gdk debugging flags to unset --display=DISPLAY X display to use --screen=SCREEN X screen to use --sync Make X calls synchronous --name=NAME Program name as used by the window manager --class=CLASS Program class as used by the window manager --gtk-debug=FLAGES Gtk+ debugging flags to set --gtk-no-debug=FLAGS Gtk+ debugging flags to unset --g-fatal-warnings Make all warnings fatal --gtk-module=MODULE Load an additional Gtk module --oaf-ior-fd=FD File descriptor to print IOR on --oaf-activate-iid=IID IID to activate --oaf-private Prevent registering of server with OAF --disable-sound Disable sound server usage --enable-sound Enable sound server usage --espeaker=HOSTNAME:PORT Host:port on which the sound server to use is running --version Print the current version of distccmon-gnome --sm-client-id=ID Specify session management ID --sm-config-prefix=PREFIX Specify prefix of saved configuration --sm-disable Disable connection to session manager --disable-crash-dialog Disable Crash Dialog AUTHOR
Distccmon-gnome was written by Martin Pool. This manual page was written by Mohammed Adnene Trojette for the Debian project (but may be used by others). March 1, 2005 Distccmon-gnome(1)
All times are GMT -4. The time now is 11:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy