3 * $Id: ushell.c,v 1.2 1999/04/21 09:07:55 mdw Exp $
5 * Extract a user's shell
7 * (c) 1999 Mark Wooding
10 /*----- Licensing notice --------------------------------------------------*
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software Foundation,
24 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 /*----- Revision history --------------------------------------------------*
30 * Revision 1.2 1999/04/21 09:07:55 mdw
31 * Fiddle with copyright messages so that they're correct.
33 * Revision 1.1.1.1 1999/04/20 00:19:04 mdw
38 /*----- Header files ------------------------------------------------------*/
45 #include <sys/types.h>
48 /*----- Main code ---------------------------------------------------------*/
50 static const char *quis;
52 int main(int argc, char *argv[])
56 /* --- Resolve the program name --- */
61 for (q = argv[0]; *q; q++) {
68 /* --- Get the argument name --- */
71 fprintf(stderr, "Usage: %s username\n", quis);
75 /* --- Read the user information --- */
77 if ((pw = getpwnam(argv[1])) == 0) {
78 fprintf(stderr, "%s: user `%s' doesn't exist", quis, argv[1]);
88 /*----- That's all, folks -------------------------------------------------*/