03-02-2010
Scripting - process and user ids...Help please
Hello all:
Working on a job I was asked get a simple script to perform the following task and would like to ask for some help. I'm looking forward to learning more and diving deeper into the World of Open Source servers.
I need a script for a Unix server, using as few lines as possible, that generates a list of users that have active processes on a server and the number of processes for each of those users.
I know the basic scripting and syntax of creating structured code creation as I had to take a bunch of programming classes in college, and have created many batch apps in the command line world.
I'm assuming there is a show process command, and for some reason I want to say it's something like sho usr or close to that.
If it was commented out that would be really great too.
Would someone please be so kind to assist me or have an old one lying around?
Many thanks in advance for your consideration,
Mo-
10 More Discussions You Might Find Interesting
1. Programming
Hello,
Can some one tell how to read the thread IDs of the current process in Sun Solaris.
Any help will be appreciated.
regards,
Murali (0 Replies)
Discussion started by: hmurali
0 Replies
2. UNIX for Advanced & Expert Users
Hello All,
I need to track the exact process ID related to a particular application running on HP-UX machine. i.e. the exact functionality of fuser unix command.
fuser application.log // It gives the exact process ID for application.log
Since there is no provision for 'fuser' in HP-UX... (13 Replies)
Discussion started by: abhishek0071
13 Replies
3. Shell Programming and Scripting
Hi
I have to validate the user ids. It should be numeric. I am using following code
echo $input | grep '^\{11\} > /dev/null
if
echo "error"
else
echo "Success"
fi
But when i entered user id as 828^&% the output is
8565
8566
-bash: ^: command not found
Means when i entered... (4 Replies)
Discussion started by: KiranKumarKarre
4 Replies
4. Shell Programming and Scripting
Hi all,
I need a script that will loop around all the current processes and take a pmap -x <process id> and output each pmap to a separate file.
Would anyone have a quick command to do this? (2 Replies)
Discussion started by: borderblaster
2 Replies
5. AIX
Hi All
what is the command to check process ids , which are running from long time and which are consuming more cpu?
Also how to check, what a particular PID is running what
For Ex:
i have a pid :3223722 which is running since from long time,
if i want to check what is this... (1 Reply)
Discussion started by: sidharthmellam
1 Replies
6. Shell Programming and Scripting
Hi,
I need a script to kill the process Ids for the user ABC.
I prepared the following script after that while logging with user therough script i am not sure how to pass the user name and password.Can ou modify the script and help me out.
#!/bin/bash
for filesize in $(ls -ltr | grep... (4 Replies)
Discussion started by: victory
4 Replies
7. Shell Programming and Scripting
Please help me with this question
I have a tantan.sh under /home/mydir which is a caller to another script "tantan.sh" under /home/anotherdir
-----------------------------------------------------------
/home/mydir/tantan.sh
------------------------------------------------------------... (6 Replies)
Discussion started by: guruincredible
6 Replies
8. AIX
if I want to create a bundle of user ids on some aix servers, if there is a way not need to do "passwd username" one by one user to set the password?
Thanks (3 Replies)
Discussion started by: rainbow_bean
3 Replies
9. Shell Programming and Scripting
Hi,
I have four tomcat instances named PNK, PNK1, PNK2, PNK3.
All are running on the same server.
To kill tomcat instance I usually do below for PNK1,PNK2,PNK3
kill -9 `ps -ef|grep tomcat|grep PNK1|grep -v grep|awk '{print $2}'`
But the above command does not work for PNK. Can some... (7 Replies)
Discussion started by: lpprasad321
7 Replies
10. Shell Programming and Scripting
Hi,
I need to list out the processes which are started/restarted today in my Solaris box. If not possible need to convert the process uptime in minutes or seconds and compare it with a configurable value to list out those process ids for further processing in my scripting.
Can any one guide... (7 Replies)
Discussion started by: ananan
7 Replies
faxrm(1) mgetty+sendfax manual faxrm(1)
NAME
faxrm - remove fax jobs queued by faxspool(1)
SYNOPSIS
faxrm [-i] [job-ids...]
DESCRIPTION
Remove job(s) from the fax queue set up by faxspool(1).
faxrm removes queued fax jobs. Call with a list of job-IDs to remove specific jobs. Call with no job IDs to be asked interactively about
all jobs you own (if run by root, all jobs). For job-id, use the strings returned by faxq(1) (e.g. F000015), without the ``/JOB'' exten-
tion.
If you are not the owner of the fax job (as per the 'user xyz' statement inside the JOB file), you are not allowed to remove the fax job.
Only root is permitted to remove another user's faxes.
If the job is locked (most likely because sendfax(8) is active sending it), faxrm doesn't attempt to remove it. Instead, it prints a warn-
ing message on stderr and goes on to the next job.
EXAMPLES
faxrm F000005 F000033
OPTIONS
-i (interactive mode) Tells faxrm to ask for confirmation before removing the job (UNIMPLEMENTED).
BUGS
faxrm doesn't return diagnostic exit codes yet.
SEE ALSO
faxrunq(1), faxrunq(8), faxspool(1), faxq(1), faxqueue(5)
AUTHOR
faxrm is Copyright (C) 1993-2002 by Gert Doering, <gert@greenie.muc.de>.
greenie 23 Nov 02 faxrm(1)