Sponsored Content
Full Discussion: Need some help with this...
Top Forums Programming Need some help with this... Post 302138225 by Legend986 on Sunday 30th of September 2007 01:49:16 PM
Old 09-30-2007
Here's the output if that would help:

Code:
gma@server1 [~/public_html/os/skeleton]# ./uwhich -a curl

i is 0
        Errno: 2        /usr/local/jdk/bin/curl
i is 1
        Errno: 2        /usr/kerberos/bin/curl
i is 2
        Errno: 2        /usr/lib/courier-imap/bin/curl
i is 3
        Errno: 2        /usr/local/bin/curl
i is 4
        Errno: 2        /bin/curl
i is 5
/usr/bin/curl   0
/usr/bin/curl
i is 6
        Errno: 2        /usr/X11R6/bin/curl
i is 7
        Errno: 2        /usr/local/bin/curl
i is 8
        Errno: 2        /usr/X11R6/bin/curl
i is 9
Segmentation fault (core dumped)
gma@server1 [~/public_html/os/skeleton]# echo $PATH
/usr/local/jdk/bin:/usr/kerberos/bin:/usr/lib/courier-imap/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/home/enigma/bin
gma@server1 [~/public_html/os/skeleton]#

The program is working fine till the last directory and after that its giving a Segmentation Fault... I don't know why that is happening...
 
getusershell(3C)					   Standard C Library Functions 					  getusershell(3C)

NAME
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)
All times are GMT -4. The time now is 11:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy