Sponsored Content
Full Discussion: how to get real user name
Top Forums Shell Programming and Scripting how to get real user name Post 302129793 by aga on Wednesday 1st of August 2007 04:07:12 PM
Old 08-01-2007
Thanks for your hint but is it possible to do this without using the 'awk' command???
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

In real time - what user connects or disconnect

Write a tool that will be displayed in real time, what user connects or disconnects from a system that uses this tool :)) Maybe anyone can help me? (2 Replies)
Discussion started by: titasas
2 Replies

2. Solaris

Help with who am i . Not displaying real user

Hi I'm trying to get the real username of any user running as root on my server. On one of my server running Sol 10, if I su to root and run who am i, it displays my username. which is what I want. But when I run it on another server, this time on Sol 8, it displays root as the user. Is... (9 Replies)
Discussion started by: wisdom
9 Replies

3. Shell Programming and Scripting

Wget script to simulate real user visits

so i'm using the following script to attempt to simulate a user visiting a page but unfortunately, it doesn't look like this is working: wget -nv -r "http://www.mywebsite.com" does anyone have a better idea of how to do this? the goal here is to run a wget command from a linux host to a... (3 Replies)
Discussion started by: SkySmart
3 Replies

4. Shell Programming and Scripting

Log all the commands input by user at real time in /var/log/messages

Below is my script to log all the command input by any user to /var/log/messages. But I cant achieve the desired output that i want. PLease see below. function log2syslog { declare COMMAND COMMAND=$(fc -ln -0) logger -p local1.notice -t bash -i -- "$USER:$COMMAND" } trap... (12 Replies)
Discussion started by: invinzin21
12 Replies

5. UNIX for Advanced & Expert Users

Regarding real example of user of semicolon(;) and + in find/exec command.

Hello All, Was recently working on an requirement where we have to search files more than a specific number, following is the example on same. Let's say file names are test_40000.txt,test_40001.txt and so on till test_99999.txt. Now requirement was to search from find command only those... (1 Reply)
Discussion started by: RavinderSingh13
1 Replies

6. Programming

Real, effective and saved user id in C program

I figured it out by now. (0 Replies)
Discussion started by: Ralph
0 Replies
SETREUID(2)						     Linux Programmer's Manual						       SETREUID(2)

NAME
setreuid, setregid - set real and/or effective user or group ID SYNOPSIS
#include <sys/types.h> #include <unistd.h> int setreuid(uid_t ruid, uid_t euid); int setregid(gid_t rgid, gid_t egid); DESCRIPTION
setreuid sets real and effective user IDs of the current process. Unprivileged users may only set the real user ID to the real user ID or the effective user ID, and may only set the effective user ID to the real user ID, the effective user ID or the saved user ID. Supplying a value of -1 for either the real or effective user ID forces the system to leave that ID unchanged. If the real user ID is set or the effective user ID is set to a value not equal to the previous real user ID, the saved user ID will be set to the new effective user ID. Completely analogously, setregid sets real and effective group ID's of the current process, and all of the above holds with "group" instead of "user". RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately. ERRORS
EPERM The current process is not the super-user and changes other than (i) swapping the effective user (group) ID with the real user (group) ID, or (ii) setting one to the value of the other or (iii) setting the effective user (group) ID to the value of the saved user (group) ID was specified. NOTES
Setting the effective user (group) ID to the saved user ID is possible since Linux 1.1.37 (1.1.38). CONFORMING TO
BSD 4.3 (the setreuid and setregid function calls first appeared in 4.2BSD). SEE ALSO
getuid(2), getgid(2), setuid(2), setgid(2), seteuid(2), setresuid(2) Linux 1.1.38 1994-08-02 SETREUID(2)
All times are GMT -4. The time now is 02:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy