how to run who am i from remote session


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to run who am i from remote session
# 1  
Old 08-25-2008
how to run who am i from remote session

I just moved from AIX 4 to AIX 5.3. the command `who am i` is essential to our logon scripts; but it does not work anymore, it says the process is not attached to a terminal. Is it possible to run this command remotely? It works for remote root sessions. If it is not is there another way to accurately determine the IP address the remote session is currently using? Thanks
# 2  
Old 08-25-2008
I solved my own problem, found out $$ is the PID of the current sesison, so instead of
Code:
who am i | awk '{print$6}'

I simply did
Code:
who -u | grep $$ | awk '{print$8}'

works great and everything is rolling along as it should again.
# 3  
Old 08-25-2008
have you tried
whoami ?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Run only 3 sqlplus session at a time

Below code runs n number of session at a time when called. I want to restrict it to run only for 3 sqlplus at a time. Is there a way to do the same. for name in `cat abc.txt` do (sqlplus -s usert/password@host <<-EOF>> error.txt SET LINESIZE 1000 select '$name',... (4 Replies)
Discussion started by: ATWC
4 Replies

2. Shell Programming and Scripting

Ssh to multiple hosts and then run multiple for loops under remote session

Hello, I am trying to login to multiple servers and i have to run multiple loops to gather some details..Could you please help me out. I am specifically facing issues while running for loops. I have to run multiple for loops in else condition. but the below code is giving errors in for... (2 Replies)
Discussion started by: mohit_vardhani
2 Replies

3. AIX

Need to remote control client's ssh session

Is there a way that I can remotely control a user's ssh session so I can see what they are doing and walk them through the problem they are having on my AIX based application? (2 Replies)
Discussion started by: De@nneG
2 Replies

4. Shell Programming and Scripting

Getting SSH Output From Remote to Local Session?

Hi everyone, after about 2 days of scratching my head on this one, I'm finally ready to punt this and ask for some actual help. Here's the situation. We have 1 server, that runs multiple VM's. To gain access to those VM's we ssh from host01 to the other vm hosts. For example when we first log... (4 Replies)
Discussion started by: Lost in Cyberia
4 Replies

5. Shell Programming and Scripting

How to run scripts within a telnet session?

I want to connect to a remote host using telnet there is no username/password verification just telnet remotehost then I need to input some commands for initialization and then I need to repeat the following commands: cmd argument argument is read from a local file, in this... (1 Reply)
Discussion started by: esolve
1 Replies

6. Shell Programming and Scripting

Start script when a user starts a remote session

Howdy, I'm fairly new at bash scripting, but (for some reason) I've been tasked with building a bastion server and logging all (ssh/telnet) remote activity. Each session must create a unique log file - the name of each file must include the user ID, the connection method (ssh/telnet), the name... (2 Replies)
Discussion started by: kilo90
2 Replies

7. Solaris

How to reconnect to a disconnected remote ssh session

hi all How to reconnect to a disconnected remote ssh session on solaris 10 is there any way (4 Replies)
Discussion started by: h@foorsa.biz
4 Replies

8. Shell Programming and Scripting

Is it possible..when ftp session disconnect and it can automatic run again?

Hi, Is is possible when ftp script disconnect by remote server and it can restart to tranfer (such as restart in 10 mins, etc)? Please help!!!! (1 Reply)
Discussion started by: happyv
1 Replies

9. Solaris

How do I establish a remote CDE or JDS session on Solaris 10?

As stated above in the title "How do I establish a remote CDE or JDS session on Solaris 10?" What I would like to do is be able to login to and use the machine remotely using either the CDE or JDS, preferably with out having to use a VNC, and be able to use the pretty GUI, instead of exclusively... (11 Replies)
Discussion started by: ultra0384
11 Replies

10. UNIX for Dummies Questions & Answers

remote x session to a server box w/no IO

I am trying to connect to a unix server box and start an X session. It has kde and xfree86 installed. However, since it is just a server, sitting somehwere in another state probably on top of and below other servers, it has no mouse,keyboard,or monitor attached to it. When I try to startx, I... (2 Replies)
Discussion started by: SnakeO
2 Replies
Login or Register to Ask a Question