How to identify User Machine name?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to identify User Machine name?
# 8  
Old 03-01-2007
Error

Hi Jacoden,

this command is giving some error.
[/opt/tuxedo/test]set -x

[/opt/tuxedo/test]touch testfile1.txt
+ touch testfile1.txt

[/opt/tuxedo/test]who | grep $(lsof <testfile1.txt> | sed -n '2,$p'| awk '{ print $3}'|uniq)
+ who

ksh: syntax error at line 1 : `|' unexpected

Pls suggest me.

- Ganapati.
# 9  
Old 03-01-2007
Quote:
lsof <testfile1.txt>
lsof testfile1.txt
# 10  
Old 03-01-2007
Power

matrixmadan,

tried ur suggestion and got the below error:

[/opt/tuxedo/lokesha]who | grep $(lsof testfile1.txt| sed -n '2,$p'| awk '{ print $3}'|uniq)
ksh: lsof: not found
Usage: grep -hblcnsviw pattern file . . .


can u pls explain what is "lsof" ? which seems to be not installed for me!!! Smilie

Cheers~~
Ganapati.
# 11  
Old 03-01-2007
Quote:
Originally Posted by ganapati
matrixmadan,

tried ur suggestion and got the below error:

[/opt/tuxedo/lokesha]who | grep $(lsof testfile1.txt| sed -n '2,$p'| awk '{ print $3}'|uniq)
ksh: lsof: not found
Usage: grep -hblcnsviw pattern file . . .


can u pls explain what is "lsof" ? which seems to be not installed for me!!! Smilie

Cheers~~
Ganapati.

Seems lsof is not installed for you.

If installed should be available in /usr/sbin/lsof

lsof - this would display files opened by processes
# 12  
Old 03-01-2007
Question

how to instal it?

any idea matrixmadan.

- Smilie Mysore Ganapati
# 13  
Old 03-01-2007
you can download from
http://www.sunfreeware.com/

and install
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to identify user?

Hi Team I have created some time back a user called "iuser" but I am not able to login with it. I am getting below error. # su - iuser su: user iuser does not exist tried to unlock the user still get same error # pam_tally2 -u iuser -r pam_tally2: pam_get_uid; no such user iuser... (7 Replies)
Discussion started by: scriptor
7 Replies

2. Cybersecurity

Please help identify these user account

Please help me identify these user accounts.. bin, lp, nuucp, smbnull, mysql, tftp Can we remove these user or disable these users?We have to apply the security policy about the user identification.Since it was settup by our vendor long time ago. We do not have these informations about these... (3 Replies)
Discussion started by: rdstkg
3 Replies

3. AIX

Identify User Attributes

SOS Guys... Is there any way to determine the user attributes, mainly if that userid is set as never expire? I do not have admin rights, and I'm working on AIX 5.3 I've tried : lsuser -f <username> but no luck on that (2 Replies)
Discussion started by: freakygs
2 Replies

4. Shell Programming and Scripting

Tricky little problem, send signal to other machine without user

Hi everyone! I want to be able to send a signal to another machine on the same network, and have it trigger a script on that machine. Here's the reason why I can't just ssh: I don't have a username on that machine, but there is a user that is always logged on that I can do stuff on. So, I want... (5 Replies)
Discussion started by: declannalced
5 Replies

5. Shell Programming and Scripting

User perl to get memory installed in a machine

I currently have a statistics gathering script i run on my Linux servers. One of the stat i gather is total memory in the machine. The script is all perl with the exception of gathering the memory for that i use the following command: $ram = (`cat /proc/meminfo | grep "MemTotal" | awk... (1 Reply)
Discussion started by: insania
1 Replies

6. Shell Programming and Scripting

Identify root like user.

Hi All, I wanted to know if there is any way , in which a user could be identified. I need to diffrenciate between a root user and a root like user. Thanks! nua7 (4 Replies)
Discussion started by: nua7
4 Replies

7. UNIX for Advanced & Expert Users

scp from user A in machine 1 to user B in machine 2

Hi all, would like to find out how can i scp a file from user A in one host to user B in another host? i know how to get it done if its from user A in machine 1 to user A in machine 2. 1)on machine 1, generate a key pair. put the private key in the .ssh directory. 2)put the public key in... (2 Replies)
Discussion started by: new2ss
2 Replies

8. Shell Programming and Scripting

Identify specific processes from different Machine

Hi, i;m getting a hard time on how to have this kind of script. 1. ssh on another machine and check if a specific process is running and notify in there is a problem. SOS!!!!!!!!!!!!! :( (2 Replies)
Discussion started by: tungaw2004
2 Replies

9. UNIX for Advanced & Expert Users

Identify a remote machine as windows or unix

Hi, I have a IP address of the target machine.Is there is any way to find out whether it is a unix box or windows box without logging into it?. Regs Anand (5 Replies)
Discussion started by: u449064
5 Replies

10. Shell Programming and Scripting

Executing Script of a different user on Same Machine

Hi, I want to execute a script - of different user from my script. I have tried the su command su - username -c "scriptname" it works but asked for password. Is there any way for supplying the password to it thru script, not interactively. Or is there any other way to achieve the... (5 Replies)
Discussion started by: yeheyaansari
5 Replies
Login or Register to Ask a Question