Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Scripting - process and user ids...Help please Post 302399913 by moahten on Tuesday 2nd of March 2010 01:32:38 AM
Old 03-02-2010
Thanks so much!

Here is what I was coming up on my own.

I understand most of what is happening, however could you let me know If I'm interpreting your example correctly?


ps, by itself, shows you information about only your processes. To learn more about all of the processes that are running, use the -ef options with the ps command.
Code:
$ ps -ef UID   PID  PPID  C    STIME TTY      TIME COMD
root     0     0  0   Mar 18 ?        0:01 sched
root     1     0  0   Mar 18 ?        1:09 /sbin/init
root   286   279  0   Mar 23 ?        0:08 /usr/lib/saf/ttymon
root   279     1  0   Mar 23 ?        0:04 /usr/lib/saf/sac -t 300
root   262     1  0   Mar 23 ?        0:02 /usr/X/bin/xdm
aja1 11687   262  0 16:37:28 ?        1:10 /usr/X/bin/xdm
aja1 17764 11687  0 07:57:51 ?        0:03 -wksh
root   288   279  0   Mar 23 ?        0:05 /usr/lib/saf/ttymon
aja1 17867 17866  0 08:08:47 pts/2    0:04 wksh
root   344     1  0   Mar 23 ?        0:01 /usr/lib/lpsched
root   326     1  0   Mar 23 ?        5:25 /usr/sbin/cron
aja1 18333 18154  0 09:03:40 pts/3    0:00 wksh
stu1 19305 19286 31 10:58:19 pts/4    0:01 ps -ef
stu1 19207 17867  0 10:52:50 pts/2    0:01 -ksh
$ _}

I understand most of what is happening, however could you let me
know If I'm interpreting your example correctly?

Can you show me an example of your output? I'm at home and can't try it myself. I would be very appreciative.
I realize I'm being a pain, however If you can I'd be very happy.

Many thanks,
Mo-

---------- Post updated at 10:32 PM ---------- Previous update was at 10:16 PM ----------

If I was going to be contructing this in good form:

I thought it might look something like what I started below and commented out so even a newby like me can quickly look at it and see what is happening.

I like to have the output be formatted in a manner that is a little more self explanitory.

Can you let me know if I'm on the right track? Am I missing something fundamental? Am I doing something stupid? All assistance is most welcome.
Thanks,


Code:
#!/bin/bash 

# Title........: serv_u_p
# Description..: Displays Server user and processes
# Author.......: Mo Ahten - TBD 
# Contact......: moahten_____
# Last Modified: 03/01/10 
#----------------------------------
 
# Begin script
$ ps –ef >> serv_u_p.txt
# End Script


Last edited by pludi; 03-02-2010 at 02:41 AM.. Reason: code tags, please!!!
 

10 More Discussions You Might Find Interesting

1. Programming

List of Thread IDs of a process

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

Problem to track process IDs in HP-UX machine

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

validate user ids

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

script to loop all process ids and take pmap

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

Process ids consuming huge resources ?

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

Script for to kill the process Ids when restarting the unix server

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

ps returning more process ids

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

Create a bundle of user ids

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

Search process ids

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

List out Process ids restarted today

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
getty(1M)                                                 System Administration Commands                                                 getty(1M)

NAME
getty - set terminal type, modes, speed, and line discipline SYNOPSIS
/usr/lib/saf/ttymon [-h] [-t timeout] line [ speed [ type [linedisc]]] /usr/lib/saf/ttymon -c file DESCRIPTION
getty sets terminal type, modes, speed, and line discipline. getty is a symbolic link to /usr/lib/saf/ttymon. It is included for compati- bility with previous releases for the few applications that still call getty directly. getty can only be executed by the super-user, (a process with the user ID root). Initially getty prints the login prompt, waits for the user's login name, and then invokes the login command. getty attempts to adapt the system to the terminal speed by using the options and arguments specified on the command line. Without optional arguments, getty specifies the following: The speed of the interface is set to 300 baud, either parity is allowed, NEW- LINE characters are converted to carriage return-line feed, and tab expansion is performed on the standard output. getty types the login prompt before reading the user's name a character at a time. If a null character (or framing error) is received, it is assumed to be the result of the user pressing the BREAK key. This will cause getty to attempt the next speed in the series. The series that getty tries is determined by what it finds in /etc/ttydefs . OPTIONS
The following options are supported: -h If the -h flag is not set, a hangup will be forced by setting the speed to zero before setting the speed to the default or a specified speed. -t timeout Specifies that getty should exit if the open on the line succeeds and no one types anything in timeout seconds. -c file The -c option is no longer supported. Instead use /usr/sbin/sttydefs -l to list the contents of the /etc/ttydefs file and perform a validity check on the file. OPERANDS
The following operands are supported: line The name of a TTY line in /dev to which getty is to attach itself. getty uses this string as the name of a file in the /dev directory to open for reading and writing. speed The speed argument is a label to a speed and TTY definition in the file /etc/ttydefs. This definition tells getty at what speed to run initially, what the initial TTY settings are, and what speed to try next, (should the user press the BREAK key to indicate that the speed is inappropriate). The default speed is 300 baud. type and linedisc These options are obsolete and will be ignored. FILES
/etc/ttydefs ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsr | +-----------------------------+-----------------------------+ SEE ALSO
ct(1C), login(1), sttydefs(1M), ttymon(1M), ioctl(2), attributes(5), tty(7D) SunOS 5.10 14 Sep 1992 getty(1M)
All times are GMT -4. The time now is 07:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy