02-19-2008
Your only solution:
use "who am i" and keep the first field giving you the HP equivalent...
All the best
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Folks,
In a Unix (ksh) script, is there a way to determine the current working directory path of another logged-in user? Of course, I can use "pwd" to find my own path. But, how do I find it for another active user?
Thanks for any input you can provide. LY (6 Replies)
Discussion started by: liteyear18
6 Replies
2. UNIX for Dummies Questions & Answers
Is there a simple command in the vein of `oslevel` under AIX 4.3 to show the current patch level of the machine? (2 Replies)
Discussion started by: sam_pointer
2 Replies
3. Programming
I was hoping to get some assistance with this C program I am working on. The goal is to find the largest file in the current directory and then display this filename along with the filesize. What I have so far will display all the files in the current directory. But, how do I deal with "grabbing"... (1 Reply)
Discussion started by: AusTex
1 Replies
4. Shell Programming and Scripting
The title says it all really. I am writing a shell script for a Linux box, and I have recently run into a problem. I need to make sure I am at a certain run level first.
Hence, the question. How can I find out what run level the box is currently running at?
Is there a system variable... (2 Replies)
Discussion started by: Scripting Newb
2 Replies
5. Shell Programming and Scripting
Hi Gurus,
I have a directory A, which has some 0 byte files in it.
This directory also has a subdirectory B which also has some 0 byte files in it.
The problem:
I only need to find out the names of the 0 byte files in the directory A.
I'm using the following command
find . -name *.zip... (6 Replies)
Discussion started by: ramky79
6 Replies
6. Shell Programming and Scripting
Hi,
I have a very urgent requirement here. I have to find all files in the specified directory but not in the sub directories(The directory name is stored in a variable) which are older than the current date as well as current time and rename it as filename_yyyymmddhhmmss.ext and move it into a... (7 Replies)
Discussion started by: ragavhere
7 Replies
7. Shell Programming and Scripting
Hi All
I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age.
I have experimented with the find command in unix but it also searches all sub directories. I have... (2 Replies)
Discussion started by: kewong007
2 Replies
8. Shell Programming and Scripting
Hi All,
I am trying to find 4 latest files inside one folder having following File Name pattern and store them into 4 different variables and then use for processing in my shell script. File name is fixed length.
1) Each file starts with = ABCJmdmfbsjop letters + 7 Digit Number... (6 Replies)
Discussion started by: lancesunny
6 Replies
9. Solaris
Hi,
Am writing a script where I want to find uptime of certain servers. Is there any command where we can find uptime without login to the server, since the server list is big logging to the server will time consuming.
Thanks in advance (7 Replies)
Discussion started by: rogerben
7 Replies
10. UNIX for Advanced & Expert Users
Hey folks,
When a user is added to a new group, the user has to be log out and log in again to make the new group effective. Is there any system command or technique to refresh user group ID update without re-login?
I am not talking about to use "login" or "su -l" commands which can only make... (2 Replies)
Discussion started by: hce
2 Replies
LEARN ABOUT HPUX
getlogin
getlogin(3C) getlogin(3C)
NAME
getlogin(), getlogin_r() - get name of user logged in on this terminal
SYNOPSIS
DESCRIPTION
The function retrieves the name of the user currently logged in on a terminal associated with the calling process, as found in user-
accounting database maintained by utmpd(1M).
At least one of the standard input, standard output, or standard error must be a terminal. For the first of these found that is a termi-
nal, a user must have logged in on that terminal, and that terminal must be the controlling terminal of the session leader process of the
calling process's session.
The function can be used in conjunction with to locate the correct password file entry when the same user ID is shared by several login
names.
The recommended procedure to obtain the user name associated with the real user ID of the calling process is to call and if that fails, to
call
To get the user name associated with the effective user ID, call
performs the same operations as but returns the login name in the buffer to which buf points, whose size in bytes should be passed in
buflen. buf should have space for the name and the terminating null character. The maximum size of the login name can be obtained using
the API with as the argument.
APPLICATION USAGE
The return value from points to static data whose content is overwritten by each call.
RETURN VALUE
Upon successfully finding and validating the login name of the user logged in on the terminal, returns a pointer to the name. Otherwise,
it returns a null pointer, and sets to indicate the error.
Upon successfully finding, validating, and copying to the buffer the login name of the user logged in on the terminal, returns 0 upon suc-
cess and returns an error number upon failure.
ERRORS
and fail if any of the following is true:
[EACCES] Access permission to get the status of the terminal device file, was denied.
[EMFILE] Too many file descriptors are in use by this process.
[ENFILE] Too many file descriptors are in use on the system.
[ENOENT] The terminal device file cannot be found.
[ENOTTY] None of the standard input, standard output, or standard error is a terminal, or for the first of these that is a
terminal, no current login is registered on that terminal, or the session leader process of the calling process has
no controlling terminal.
[EPERM] One of the standard input, standard output, or standard error is a terminal, and a current login was found on that
terminal, but that terminal is not the same as the controlling terminal of the session of the calling process.
[ESRCH] The session leader process of the calling process is no longer running.
The error condition associated with [EPERM] prevents processes that have access to some other user's terminal from believing that they are
related to that other user's login session.
also fails if the following is true:
[ERANGE] The length of the name to be returned, including the terminating null byte, exceeds buflen.
WARNINGS
Users of should note now conforms with the POSIX.1c Threads standard. The old prototype of is supported for compatibility with existing
DCE applications only.
SEE ALSO
utmpd(1M), getuid(2), sysconf(2), getgrent(3C), getpwent(3C), thread_safety(5).
STANDARDS CONFORMANCE
getlogin(3C)