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.