Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

getusershell(3C)

NAME

getusershell, setusershell, endusershell − get legal user shells

SYNOPSIS

char ∗getusershell()
void setusershell()
void endusershell()

DESCRIPTION

getusershell() returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells.  If /etc/shells does not exist, a list of the ten locations of the standard system shells: /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, /usr/bin/jsh, /bin/sh, /bin/csh, /bin/ksh, /bin/jsh, /sbin/sh, /sbin/jsh, are used instead of the file. 

getusershell() (opens the file /etc/shells if it exists) returns the next entry in the list of shells. 

setusershell() rewinds the file, or the list. 

endusershell() closes the file, and frees any memory used by getusershell() and setusershell().  As a side effect, endusershell() rewinds the file /etc/shells. 

FILES

/etc/shells

/usr/bin/sh

/usr/bin/csh

/usr/bin/ksh

/usr/bin/jsh

/bin/sh

/bin/csh

/bin/ksh

/bin/jsh

/sbin/sh

/sbin/jsh

RETURN VALUES

getusershell() returns a NULL pointer on EOF. 

BUGS

All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved. 

SunOS 5.5.1  —  Last change: 30 Jan 1995

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026