Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #135
Difficulty: Easy
As of 2006, approximately five percent of the Linux kernel was written by Linus Torvalds himself
True or False?
Linux & Unix Commands - Search Man Pages

getusershell(3c) [opensolaris man page]

getusershell(3C)					   Standard C Library Functions 					  getusershell(3C)

getusershell, setusershell, endusershell - get legal user shells SYNOPSIS
#include <unistd.h> char *getusershell(void); void setusershell(void); void endusershell(void); DESCRIPTION
The getusershell() function 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, the following locations of the standard system shells are used in its place: /bin/bash /bin/csh /bin/jsh /bin/ksh /bin/ksh93 /bin/pfcsh /bin/pfksh /bin/pfsh /bin/sh /bin/tcsh /bin/zsh /sbin/jsh /sbin/pfsh /sbin/sh /usr/bin/bash /usr/bin/csh /usr/bin/jsh /usr/bin/ksh /usr/bin/ksh93 /usr/bin/pfcsh /usr/bin/pfksh /usr/bin/pfsh /usr/bin/sh /usr/bin/tcsh /usr/bin/zsh /usr/sfw/bin/zsh /usr/xpg4/bin/sh The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells. The setusershell() function rewinds the file or the list. The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells. RETURN VALUES
The getusershell() function 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. NOTES
Restricted shells should not be listed in /etc/shells. SunOS 5.11 1 Nov 2007 getusershell(3C)

Check Out this Related Man Page

shells(4)							   File Formats 							 shells(4)

shells - shell database SYNOPSIS
/etc/shells DESCRIPTION
The shells file contains a list of the shells on the system. Applications use this file to determine whether a shell is valid. See getuser- shell(3C). For each shell a single line should be present, consisting of the shell's path, relative to root. A hash mark (#) indicates the beginning of a comment; subsequent characters up to the end of the line are not interpreted by the routines which search the file. Blank lines are also ignored. The following default shells are used by utilities: /bin/bash, /bin/csh, /bin/jsh, /bin/ksh, /bin/ksh93, /bin/pfcsh, /bin/pfksh, /bin/pfsh, /bin/sh, /bin/tcsh, /bin/zsh, /sbin/jsh, /sbin/sh, /usr/bin/bash, /usr/bin/csh, /usr/bin/jsh, /usr/bin/ksh, /usr/bin/ksh93, /usr/bin/pfcsh, /usr/bin/pfksh, /usr/bin/pfsh, and /usr/bin/sh, /usr/bin/tcsh, /usr/bin/zsh, and /usr/sfw/bin/zsh. /etc/shells overrides the default list. Invalid shells in /etc/shells could cause unexpected behavior, such as being unable to log in by way of ftp(1). FILES
/etc/shells list of shells on system SEE ALSO
vipw(1B), ftpd(1M), sendmail(1M), getusershell(3C), aliases(4) SunOS 5.11 20 Nov 2007 shells(4)

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need a help in shell script

Hi All I am new to shell script .. can anyone help me on this i have a file c1.txt cool:niceone revoke similar jeep 34343 34343 cool:notone aefdfdd sdsdsds sdsdsds sdsdsd (32 Replies)
Discussion started by: raghav1982
32 Replies

2. UNIX for Dummies Questions & Answers

.bashrc question re: rm -i & ls --colors

QUESTION #1: I have this in my .bashrc file: alias rm='rm -i' Problem is, there are 3 files that I remove many times a day and would like this command to ignore these 3 files. In other words, prompt me on everything EXCEPT these 3 files. Is this possible? QUESTION #2: Also in... (16 Replies)
Discussion started by: kthatch
16 Replies

3. UNIX for Dummies Questions & Answers

How to pass array as an arguement ?

Hi experts, I am here again with another Issue. I need to pass the array as parameter / argument to another script. I tried it as follows . ( I got this idea from the link ) $ cat #! /usr/bin/ksh set -a arr1 echo "...In Test1...." arr1="APPS_DEV" arr1="TEST_DEV" echo... (16 Replies)
Discussion started by: rajavu
16 Replies

4. Shell Programming and Scripting

strange ksh arithmetic

Hello, I would like to understand this... I'm using ksh and doing (( z = y - 1 )) if y=34, then the result for z is 33, but if y=034 the result is z=27. Why?? Thanks (15 Replies)
Discussion started by: fbg
15 Replies

5. AIX

losing /usr/bin directory

I need help figuring out why I lose /usr/bin directory sometimes it goes down 3-4 times a day and I have to link them back using ln - /usr/bin bin I cannot figure out why this is happenning (23 Replies)
Discussion started by: smatherly
23 Replies

6. Shell Programming and Scripting

Compare log files and get latest

I have a directory location where in some logs gets generated whenever some application build is triggered. I need to send the generated log as an email to end user. I will get files like abcyyyy_mm_dd_time.log and next file will have different time for same day. Need to run a cron and take the... (18 Replies)
Discussion started by: yogi90
18 Replies

7. Solaris

Solaris - /usr/bin/rm file

Hi , Can anyone tel me how to read the content of /usr/bin/rm file and pls tell me is it possible to edit that file??? (23 Replies)
Discussion started by: sudhan143
23 Replies

8. Shell Programming and Scripting

cshell script problem

Hi ,I have this simple code,why is not working thanks #!/bin/csh set res=find ./ -name "*.bash" | wc -l $res > result.txt (16 Replies)
Discussion started by: lio123
16 Replies

9. Homework & Coursework Questions

Shell Script average runtime

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Make a bash script that calculates average runtime for the first two scripts you made. The average should be... (17 Replies)
Discussion started by: navlelo
17 Replies

10. UNIX for Dummies Questions & Answers

rm command issue

Hi, Getting the below error. rm *.txt bash: /usr/bin/rm: Arg list too long I understand the error is because there are lakhs of .txt file. Any fix ? (16 Replies)
Discussion started by: mohtashims
16 Replies

11. UNIX for Dummies Questions & Answers

Decrementing numbers

I have a file which has numbers at the start of some of the lines. aaa aaa 1 aaa bbb ccc ddd 12345 12345 2 aaa bbb ccc ddd 12345 12345 3 aaa bbb ccc ddd 12345 12345 4 aaa bbb ccc ddd 12345 12345 bbb 5 aaa bbb ccc ddd 12345 12345 ... (15 Replies)
Discussion started by: millsy5
15 Replies

12. Shell Programming and Scripting

[Solved] Pdf Printing in Solaris

HI All I need help related to Pdf printing in I print pdf file in solaris it print can I print pdf correctly. need help asap. Regards (21 Replies)
Discussion started by: smazshah
21 Replies

13. Shell Programming and Scripting

Bash Scipting (New); Run multiple greps > multiple files

Hi everyone, I'm new to the forums, as you can probably tell... I'm also pretty new to scripting and writing any type of code. I needed to know exactly how I can grep for multiple strings, in files located in one directory, but I need each string to output to a separate file. So I'd... (19 Replies)
Discussion started by: LDHB2012
19 Replies

14. UNIX for Dummies Questions & Answers

/usr/bin/ld: cannot find -lboost_regex-mt

...... (30 Replies)
Discussion started by: larry burns
30 Replies

15. UNIX for Advanced & Expert Users

What's your most useful shell?

What's your most useful shell? /bin/sh /bin/csh /bin/ksh /bin/tcsh /bin/bash (249 Replies)
Discussion started by: zylwyz
249 Replies

Featured Tech Videos