On Wed, 18 Jun 2003, Stuart Jansen said:
<snip>
> > > > The above doesn't help in this case anyway, I want to do certain things
> > > > if the user is using ksh and certain other things if the user is using
> > > > bash.  It wouldn't matter what shell is running _my_ script, I want to
> > > > know what shell the user is using.  Man, does that make any sense?  I
> > > > don't even know if I've got the right terminology.  Anyone want to
> > > > recommend a good shell scripting book?  One that isn't too specific to
> > > > bash or ksh?

If all you're trying to do is to get a user's shell, you could write up a 
pretty short program that calls getpwnam, and outputs the shell:
#include <stdio.h>
#include <pwd.h>
#include <sys/types.h>

int main(int argc, char *argv[])
{
   struct passwd *Passwd;
   Passwd = getpwnam(argv[1]);
   printf("%s", Passwd->pw_shell);
}

Frank
---------------------------------------------------------------------------
Frank Sorenson - KD7TZK
CSR Computer Science Department
Brigham Young University
[EMAIL PROTECTED]


____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to