GETUSER(2) System Calls Manual GETUSER(2)NAME
getuser - get user name
SYNOPSIS
#include <u.h>
#include <libc.h>
char* getuser(void)
DESCRIPTION
Getuser returns a pointer to static data which contains the null-terminated name of the user who owns the current process. Getuser reads
/dev/user to find the name.
SOURCE
/sys/src/libc/port/getuser.c
SEE ALSO intro(2), cons(3)GETUSER(2)
Check Out this Related Man Page
PERROR(2) System Calls Manual PERROR(2)NAME
perror, syslog - system error messages
SYNOPSIS
#include <u.h>
#include <libc.h>
void perror(char *s)
void syslog(int cons, char *logname, char *fmt, ...)
DESCRIPTION
Perror produces a short error message on the standard error file describing the last error encountered during a call to the system. First
the argument string s is printed, then a colon, then the message and a newline. If s is 0, only the error message and newline are printed.
Syslog logs messages in the file named by logname in the directory /sys/log; the file must already exist and should be append-only. Log-
name must contain no slashes. The message is a line with several fields: the name of the machine writing the message; the date and time;
the message specified by the print(2) format fmt and any following arguments; and a final newline. If cons is set or the log file cannot
be opened, the message is also printed on the system console. Syslog can be used safely in multi-threaded programs.
SOURCE
/sys/src/libc/port/perror.c
/sys/src/libc/9sys/syslog.c
SEE ALSO intro(2), errstr(2), the %r format in print(2)BUGS
Perror is a holdover; the %r format in print(2) is preferred.
PERROR(2)
Hi the /etc/shells file is missing on some of development boxes. Is this ok? Where can I find this file?
---------- Post updated at 07:07 AM ---------- Previous update was at 07:07 AM ----------
I have solaris, linux, aix and hpux machines and on all of these machines the /etc/shells file is... (8 Replies)
Hi Expert,
I have environment where password is locally managed, not NIS, not LDAP, not Centrally managed.
In order to access to this environment I have to use Jump Box, and only from jumpbox I can login to every host. I can't login direct from inside one host within that environment to... (1 Reply)
I'm writing a script to use as a LoginHook for my Mac users. As part of this script, I need to write to a location in their home directory, but I can't seem to access the path - at this point in the login process, $HOME is empty and ~ gives the path to root's home. Unfortunately, I can't just do... (1 Reply)
Hi guys, I'd be grateful if you could have a look at my code below and give me some feedback as to why the homedir and fullname variables aren't being printed to Standard Output when the script is run. Many thanks.
read -p "Please type in username you wish to get information from: " username
... (6 Replies)
for example, if we specify,#!/usr/bin/ksh then the script will be executed in korn shell.
If we don't specify that line, the script will be executed using the default shell.
So, how we can identify the default shell for the current user?
Will it be in .profile file ?
Thanks (13 Replies)
I'm having problem with taking in arguments and be able to use the content of the argument for something else.
In this case I need to take in user names and check if the person is online using finger or who
For example, my script name is getuser
in shell I type
getuser username1 username2
I... (2 Replies)
Basically I only want particular users to know the root password, but I also want power users to be able to run certain commands with root privileges. All admins for this box will be authenticating initially through winbind (I do have a backdoor account in case winbind goes wonky)
I want... (0 Replies)
Hi All,
I need a .sh script which serves the below purpose. It would be of great help.
I am unable to perform the second need of mapping texts within the file and updating only those contents.
For Eg: There is a html file containing link abc.com. This should be replaced with xyz.com link in... (3 Replies)
i am trying to write shell script
how to write shell script which is ask for user id and password then compare both from two different file..
i have no idea how to compare with data present in file..
#!/bin/bash -e
read -p "User ID: " first
read -p "Password: " second
if ;then
echo... (3 Replies)
Hi Guys,
I need a help on writing shell scripting where I am stuck on finding keyword after a grep match.
file.log (sample)
line1 -> ppp dfasf adgasg session out sfsgsgsghsgh
line2 -> sdaf agasg sessionid: 1234Nhsh34 sdagsjhsh srhs
line3 -> sdgshytnba sessionid: 453omgt thdjdh gfhjdj... (19 Replies)
I am trying to write a shell script that will add a date to and awk command from the command prompt.
here is the line I am having difficulties.
zgrep -i playback $dir/$1-*-errors.out.gz |cut -d '|' -f 1,11,12,15 | awk -v start=${start} -v end=${end} -F '|' '{$1>=start && $1 <=end} {print $2... (7 Replies)
Hello.
In an informix context, on AIX 5.3 TL 12, we encounter this problem :
Sometimes in the day (probably when users exits from their session), a child process lose its parent (PPID is now "1") and this child is consumming lot of CPU "USER".
I tried, on different cases, "truss -p... (4 Replies)
echo $HOME return : /home/user1echo ~ return : /home/user1My_path=~/bin/"some dir1/some dir2"
kate "$My_path/some_file"Kate open a file "~/~/bin/some dir1/some dir2/some_file" which does not exists.
I was expecting kate to open : "~/bin/some dir1/some dir2/some_file"
Any help is welcome.
... (8 Replies)
Not sure where the problem is. I can run the script without any issue using the following command.
. /opt/app/scripts/cdc_migration.sh
But it fails with the below error when I try it this way
/opt/app/scripts/cdc_migration.sh
/opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)