KSH 88 - Can I find the PID for an IP connection?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting KSH 88 - Can I find the PID for an IP connection?
# 1  
Old 02-28-2010
KSH 88 - Can I find the PID for an IP connection?

Hi,

If I use this command
Code:
netstat | grep "1268"

it shows me all IP addresses connected via port 1268, which is half of what I want.

I would like to be able to then map these against a PID on the system, and also thereby get the userid.

I have done a couple of days google bashing but have come up short. I am on KSH88 so some options/commands do not work for me.

Any links or suggestions wiould be appreciated.

Cheers
Greg
# 2  
Old 02-28-2010
lsof command maybe better tool for this as netstat. Lot of option.
Code:
lsof -n -i | grep ESTABLISHED

# 3  
Old 02-28-2010
ksh, what you on solaris?
I don't suppose you have sockstat
or is it only bsd?
# 4  
Old 03-01-2010
We're on HP unix, with korn shell 88 to my knowledge. I am new to the unix scene, and will not be able to install lsof on the system. So I gotta work with natice KSH88.

I had googled and tried the lsof option, but no banana ...

No sockstat either ...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

UNIX ksh - To print the PID number and repeat count

This question is asked in an interview today that I have to return output with each PID number and the count of each PID number logged today. Here is the script that I have written. Can you confirm if that would work or not. The interviewer didn't said if my answer is correct or not. Can someone... (5 Replies)
Discussion started by: Subodh Kumar
5 Replies

2. UNIX for Dummies Questions & Answers

Ftps connection by ksh script

Hi, I'm trying to access to FTP SERVER over SSL with this script unix : (credentials are correct) #!/usr/bin/ksh USER="test" PASSWORD="pwdtest" IP="**.***.*.***" ftp -s $IP 990 << EOF >>log_ftp user $USER $PASSWORD bin passive EOF but seems that credentials are not passed... (2 Replies)
Discussion started by: nash83
2 Replies

3. UNIX for Dummies Questions & Answers

Find PID for a port

Hi, I need to find the PID for a given port on the below system. HP-UX mymachine B.11.31 U ia64 3223107173 unlimited-user license How can I ? (4 Replies)
Discussion started by: mohtashims
4 Replies

4. Shell Programming and Scripting

ksh connection to other servers

Hello, I am looking for a way for a server to launch a connection command to one of the other servers where the connection command has already embedded in it a server name, user name and a password. (2 Replies)
Discussion started by: LiorAmitai
2 Replies

5. Red Hat

How to kill a TCP connection which has status TIME_WAIT & no PID

Hi, I want to kill TCP connections which have status as TIME_WAIT & no PID (as per the output of the "netstat - p" command). Is there any command/utility available to kill connections to a specific port or IP address. The problem is that these connections don't have process ID (see... (4 Replies)
Discussion started by: Davinder31may
4 Replies

6. Shell Programming and Scripting

how to find only PID value

When I run ps -aef | grep aaa.exe it gives out put user 5091 5518 0 10:13:25 pts/1 0:00 grep aaa.exe user 4647 2479 0 09:26:31 ? 0:25 /kk/zzz/user/xxx/bin/aaa.exe user1 1111 2222 0 08:26:31 ? 0:25 /kk/zzz/user1/xxx/bin/aaa.exe I need Only PID value ie... (5 Replies)
Discussion started by: madhusmita
5 Replies

7. Shell Programming and Scripting

In ksh, how does an in-line child sub-process get its own PID?

This is not the same as a few of the other posted items dealing with sub-process pids (that I saw anyway). If zot contains: echo "main mypid: $$ - lastpid: $!" ( echo "block mypid: $$ - lastpid: $! - ppid: $PPID" ps -ef > xxx sleep 5 echo "block mypid: $$ - lastpid: $! - ppid:... (6 Replies)
Discussion started by: MichLab
6 Replies

8. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

9. UNIX for Advanced & Expert Users

Find PID's

I have a script which spawns multiple compilations. Sometimes due to some errors i have to terminate that script. Now comes the main part, how do I do that? I can see the individual compilations via ps -ef | grep compiler and also kill them via kill -9 pid But the scirpt continues: ... (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies

10. UNIX for Dummies Questions & Answers

How to find a hanging pid

I am trying to write a simple shell script to find a hanging pid and kill it.Any idea how to find a hanging pid?? (6 Replies)
Discussion started by: Ravi Kanth
6 Replies
Login or Register to Ask a Question