whoami(1B) SunOS/BSD Compatibility Package Commands whoami(1B)NAME
whoami - display the effective current username
SYNOPSIS
/usr/ucb/whoami
DESCRIPTION
whoami displays the login name corresponding to the current effective user ID. If you have used su to temporarily adopt another user,
whoami will report the login name associated with that user ID. whoami gets its information from the geteuid and getpwuid library routines
(see getuid and getpwnam(3C), respectively).
FILES
/etc/passwd username data base
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO su(1M), who(1), getuid(2), getpwnam(3C), attributes(5)SunOS 5.11 14 Sep 1992 whoami(1B)
Check Out this Related Man Page
COM_ERR(3) Library Functions Manual COM_ERR(3)NAME
com_err - common error display routine
SYNOPSIS
#include <et/com_err.h>
void com_err (whoami, code, format, ...);
const char *whoami;
long code;
const char *format;
proc = set_com_err_hook (proc);
void (* proc ) (const char *, long, const char *, va_list);
proc = reset_com_err_hook ();
void initialize_XXXX_error_table ();
DESCRIPTION
Com_err displays an error message on the standard error stream stderr (see stdio(3S)) composed of the whoami string, which should specify
the program name or some subportion of a program, followed by an error message generated from the code value (derived from compile_et(1)),
and a string produced using the format string and any following arguments, in the same style as fprintf(3).
The behavior of com_err can be modified using set_com_err_hook; this defines a procedure which is called with the arguments passed to
com_err, instead of the default internal procedure which sends the formatted text to error output. Thus the error messages from a program
can all easily be diverted to another form of diagnostic logging, such as syslog(3). Reset_com_err_hook may be used to restore the behav-
ior of com_err to its default form. Both procedures return the previous ``hook'' value. These ``hook'' procedures must have the declara-
tion given for proc above in the synopsis.
The initialize_XXXX_error_table routine is generated mechanically by compile_et(1) from a source file containing names and associated
strings. Each table has a name of up to four characters, which is used in place of the XXXX in the name of the routine. These routines
should be called before any of the corresponding error codes are used, so that the com_err library will recognize error codes from these
tables when they are used.
The com_err.h header file should be included in any source file that uses routines from the com_err library; executable files must be
linked using ``-lcom_err'' in order to cause the com_err library to be included.
SEE ALSO compile_et(1), syslog(3).
Ken Raeburn, "A Common Error Description Library for UNIX".
SIPB 22 Nov 1988 COM_ERR(3)
Hi, I am stuck in this script doing multiple grep
If I give the following, it works fine:
#!/usr/bin/ksh
export ENV=`/usr/ucb/whoami | cut -b6`
export USR=`/usr/ucb/whoami`
#Sourcing the server
. /netprov/env$ENV/server/mng/utility/syccpovdef
cd $CCP_AUDIT
echo "UserId:\c"
read... (5 Replies)
We have a situation where one of my users log's into my Solaris box and gets the followin error.....
rsh marvin
Last login: Tue Jun 28 07:28:18 from lvie450
ld.so.1: whoami: fatal: libgen.so.1: can't open file: errno=2 Killed /home/username @marvin>
Anyone have any idea?
Frank (2 Replies)
how would i go about getting the username of the person currently logged in, and then using the username in a shell script? i've tried variations of
user=whoami , 'whoami' , $whoami , and none of the above work :( lol
I'd like to get the username to then mount a network share such that the... (9 Replies)
Hi,
I want to change my command prompt to contain the current username and the current directory in it, instead of just the '$' symbol.
I tried the command:-
export PS1="$(echo \\n$) "
But whenever I switch the user or change the directory, the changes are not reflected in the command... (10 Replies)
whoami | grep < $1 | echo $1
trying to write a script that finds out who the user is and then takes occurences of that username from a file that is passed as an argument and then displays it (6 Replies)
#!/bin/sh
clear
befehle=( whoami ls who finger ps )
eingabe=5
while
do
# for i in 0 1 2 3 4
# do
# echo $i - ${befehle}
#done
echo "you're still in the loop"
read eingabe
echo "Input:" $eingabe
done
Hello, (8 Replies)
I got "Permission denied" error message when I rm or chmod a file.
I'm the owner of the file "lice_20091123.tar".
How can I solve this matter?
lice@appl:/midasapp/lice> whoami
lice
lice@appl:/midasapp/lice> who am i
guest pts/12 Nov 23 19:09 (ooo.ooo.ooo.oo) ... (3 Replies)
Is there any way to allow users to access the etc/passwd file for commands like whoami but not be able to read the file? If I don't put a user in the security group and change the permissions on the etc/passwd file to 640 (rw-r-----) the users can login but the whoami command doesn't work for... (5 Replies)
I was following a tutorial on installing Homebrew and I changed the ownership of /usr/local/ to me. Now McAfee Security won't start This is the exact line I typed:
sudo chown -R `whoami` /usr/local
Then I tried to fix it with:
sudo chown -R root /usr/local
I still can't start mcafee. It say... (7 Replies)
i feel weird with this 2 command
find /tmp/*test* -user `whoami` -mtime +1 -type f -exec rm -f {}\;
find /tmp/*test* -user `whoami` -mtime +1 -type f -exec ls -lrt {}\;
the first one return correct which only delete those filename that consist *test* where second command it listed all the... (12 Replies)
Hello All,
Hope you can understand my problem from the below code.
$ cat ~/.profile
PS1=`whoami`@`hostname`':$PWD
$ '
export PATH="$PATH:.:/logarchive/utility/util:/usr/sbin:"
$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:.:/usr/sbin:
$ echo $SHELL
/usr/bin/ksh
... (6 Replies)
// AIX 6.1 TL8
Please advise on how to capture whoami log or the user and time info into a log file (i.e. /tmp/cmdcapture.log) whenever users are executing a certain command(s) so that I can keep the single log history (for all users) of who did what. The command(s) I need to monitor are a... (3 Replies)
Hi,
i need to list the processes running only under current logged in user.
EX:
$ whoami
oraaqw
$ ps -ef | grep tnslsnr
oraaqw 11403300 19267592 0 09:14:47 pts/3 0:00 grep tnslsnr
oraaqw 15794208 1 0 Jan 14 - 11:59... (6 Replies)