Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

getuser(2) [plan9 man page]

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

GETFIELDS(2)							System Calls Manual						      GETFIELDS(2)

NAME
getfields, getmfields, setfields, tokenize - break a string into fields SYNOPSIS
#include <u.h> #include <libc.h> int getfields(char *str, char **ptrs, int nptrs) int getmfields(char *str, char **ptrs, int nptrs) char* setfields(char *fielddelim) int tokenize(char *str, char **args, int max) DESCRIPTION
Getfields breaks the null-terminated string str into at most nptrs null-terminated fields and places pointers to the start of these fields in the array ptrs. It returns the number of fields and terminates the list of pointers with a zero pointer. It overwrites some of the bytes in str. If there are nptr or more fields, the list will not end with zero and the last `field' will extend to the end of the input string and may contain delimiters. A field is defined as a maximal sequence of characters not in a set of field delimiters. Adjacent fields are separated by exactly one delimiter. No field follows a delimiter at the end of string. Thus a string of just two delimiter characters contains two empty fields, and a nonempty string with no delimiters contains one field. Getmfields is the same as getfields except that fields are separated by maximal strings of field delimiters rather than just one. Setfields makes the field delimiters (space and tab by default) be the characters of the string fielddelim and returns a pointer to a string of the previous delimiters. Tokenize breaks null-terminated string str into tokens by replacing every blank or newline with a null byte. Pointers to successive non- empty tokens are placed in args. Processing stops after max tokens are processed. Tokenize returns the number of tokens processed. Tok- enize does not terminate args with a null pointer. Alef Of these routines, only tokenize is in Alef. SOURCE
/sys/src/libc/port/getfields.c /sys/src/libc/port/tokenize.c SEE ALSO
strtok in strcat(2) GETFIELDS(2)
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

The /etc/shells file is missing.

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)
Discussion started by: manju--
8 Replies

2. Shell Programming and Scripting

Changing Passwd on Many servers that is not NIS

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)
Discussion started by: regmaster
1 Replies

3. Shell Programming and Scripting

Get Home Directory for Users in Login Hook Script

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)
Discussion started by: blondepianist
1 Replies

4. Shell Programming and Scripting

Awk variables not printing to StdOutput

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)
Discussion started by: jjb1989
6 Replies

5. UNIX for Dummies Questions & Answers

default shell for the user

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)
Discussion started by: pandeesh
13 Replies

6. Shell Programming and Scripting

Problem with command argument

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)
Discussion started by: gr33nmango
2 Replies

7. Red Hat

changing which password is prompted for in sudoers

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)
Discussion started by: thmnetwork
0 Replies

8. Shell Programming and Scripting

Help needed with Content synchronization script using rsync

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)
Discussion started by: Amulya
3 Replies

9. Shell Programming and Scripting

Compare user string with and predefined file...

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)
Discussion started by: niko420
3 Replies

10. Shell Programming and Scripting

Find sessionids after match

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)
Discussion started by: TCS
19 Replies

11. Shell Programming and Scripting

New at scripting awk with variable

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)
Discussion started by: infinity0880
7 Replies

12. AIX

Process lose its parent then consume high CPU usage ...

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)
Discussion started by: stephnane
4 Replies

13. UNIX for Beginners Questions & Answers

How the home alias (~) is it expanded?

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)
Discussion started by: jcdole
8 Replies

14. Shell Programming and Scripting

Return: can only `return' from a function or sourced script

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)
Discussion started by: svajhala
1 Replies