2 * whoami - print out username of current user
6 Copyright (C) 1999-2009 Free Software Foundation, Inc.
8 This file is part of GNU Bash.
9 Bash is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 Bash is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Bash. If not, see <http://www.gnu.org/licenses/>.
28 #include "bashgetopt.h"
36 reset_internal_getopt ();
37 while ((opt
= internal_getopt (list
, "")) != -1)
53 if (current_user
.user_name
== 0)
54 get_current_user_info ();
55 printf ("%s\n", current_user
.user_name
);
56 return (EXECUTION_SUCCESS
);
59 char *whoami_doc
[] = {
62 "Display name of current user.",
66 struct builtin whoami_struct
= {