summaryrefslogtreecommitdiff
path: root/examples/loadables
diff options
context:
space:
mode:
Diffstat (limited to 'examples/loadables')
-rw-r--r--examples/loadables/Makefile.in38
-rw-r--r--examples/loadables/README3
-rw-r--r--examples/loadables/basename.c3
-rw-r--r--examples/loadables/cat.c20
-rw-r--r--examples/loadables/cut.c3
-rw-r--r--examples/loadables/dirname.c21
-rw-r--r--examples/loadables/finfo.c8
-rw-r--r--examples/loadables/getconf.c2
-rw-r--r--examples/loadables/head.c21
-rw-r--r--examples/loadables/hello.c5
-rw-r--r--examples/loadables/id.c22
-rw-r--r--examples/loadables/ln.c21
-rw-r--r--examples/loadables/logname.c23
-rw-r--r--examples/loadables/mkdir.c21
-rw-r--r--examples/loadables/mypid.c74
-rw-r--r--examples/loadables/necho.c20
-rw-r--r--examples/loadables/pathchk.c21
-rw-r--r--examples/loadables/perl/Makefile.in34
-rw-r--r--examples/loadables/print.c22
-rw-r--r--examples/loadables/printenv.c24
-rw-r--r--examples/loadables/push.c21
-rw-r--r--examples/loadables/realpath.c25
-rw-r--r--examples/loadables/rmdir.c21
-rw-r--r--examples/loadables/sleep.c95
-rw-r--r--examples/loadables/strftime.c20
-rw-r--r--examples/loadables/sync.c22
-rw-r--r--examples/loadables/tee.c21
-rw-r--r--examples/loadables/template.c3
-rw-r--r--examples/loadables/truefalse.c25
-rw-r--r--examples/loadables/tty.c21
-rw-r--r--examples/loadables/uname.c23
-rw-r--r--examples/loadables/unlink.c21
-rw-r--r--examples/loadables/whoami.c23
33 files changed, 630 insertions, 117 deletions
diff --git a/examples/loadables/Makefile.in b/examples/loadables/Makefile.in
index f6208f5..343beb0 100644
--- a/examples/loadables/Makefile.in
+++ b/examples/loadables/Makefile.in
@@ -1,21 +1,21 @@
#
# Simple makefile for the sample loadable builtins
#
-# Copyright (C) 1996 Free Software Foundation, Inc.
+# Copyright (C) 1996-2009 Free Software Foundation, Inc.
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
# Include some boilerplate Gnu makefile definitions.
prefix = @prefix@
@@ -26,6 +26,8 @@ libdir = @libdir@
infodir = @infodir@
includedir = @includedir@
+datarootdir = @datarootdir@
+
topdir = @top_srcdir@
BUILD_DIR = @BUILD_DIR@
srcdir = @srcdir@
@@ -68,7 +70,7 @@ CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) $(CFLAGS)
SHOBJ_CC = @SHOBJ_CC@
SHOBJ_CFLAGS = @SHOBJ_CFLAGS@
SHOBJ_LD = @SHOBJ_LD@
-SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@
+SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@ @LDFLAGS@
SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@
SHOBJ_LIBS = @SHOBJ_LIBS@
SHOBJ_STATUS = @SHOBJ_STATUS@
@@ -83,7 +85,7 @@ INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \
ALLPROG = print truefalse sleep pushd finfo logname basename dirname \
tty pathchk tee head mkdir rmdir printenv id whoami \
- uname sync push ln unlink cut realpath getconf strftime
+ uname sync push ln unlink cut realpath getconf strftime mypid
OTHERPROG = necho hello cat
all: $(SHOBJ_STATUS)
@@ -186,6 +188,9 @@ realpath: realpath.o
strftime: strftime.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ strftime.o $(SHOBJ_LIBS)
+mypid: mypid.o
+ $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ mypid.o $(SHOBJ_LIBS)
+
# pushd is a special case. We use the same source that the builtin version
# uses, with special compilation options.
#
@@ -236,3 +241,4 @@ push.o: push.c
mkdir.o: mkdir.c
realpath.o: realpath.c
strftime.o: strftime.c
+mypid.o: mypid.c
diff --git a/examples/loadables/README b/examples/loadables/README
index 8a2ac81..d29b43a 100644
--- a/examples/loadables/README
+++ b/examples/loadables/README
@@ -32,9 +32,6 @@ the canonical example. There is no real `builtin writers' programming
guide'. The file template.c provides a template to use for creating
new loadable builtins.
-On Debian GNU/Linux systems, the bash headers are in /usr/include/bash.
-The appropriate options are already set in the example Makefile.
-
basename.c Return non-directory portion of pathname.
cat.c cat(1) replacement with no options - the way cat was intended.
cut.c cut(1) replacement.
diff --git a/examples/loadables/basename.c b/examples/loadables/basename.c
index 7f254c7..b5705cb 100644
--- a/examples/loadables/basename.c
+++ b/examples/loadables/basename.c
@@ -11,6 +11,7 @@
#include <stdio.h>
#include "builtins.h"
#include "shell.h"
+#include "common.h"
basename_builtin (list)
WORD_LIST *list;
@@ -90,6 +91,8 @@ basename_builtin (list)
}
char *basename_doc[] = {
+ "Return non-directory portion of pathname.",
+ "",
"The STRING is converted to a filename corresponding to the last",
"pathname component in STRING. If the suffix string SUFFIX is",
"supplied, it is removed.",
diff --git a/examples/loadables/cat.c b/examples/loadables/cat.c
index 9dd1d1a..1ce2e2d 100644
--- a/examples/loadables/cat.c
+++ b/examples/loadables/cat.c
@@ -4,6 +4,24 @@
* no options - the way cat was intended
*/
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <fcntl.h>
#include <errno.h>
@@ -84,6 +102,8 @@ WORD_LIST *list;
}
char *cat_doc[] = {
+ "Display files.",
+ "",
"Read each FILE and display it on the standard output. If any",
"FILE is `-' or if no FILE argument is given, the standard input",
"is read.",
diff --git a/examples/loadables/cut.c b/examples/loadables/cut.c
index d874034..47d7d3e 100644
--- a/examples/loadables/cut.c
+++ b/examples/loadables/cut.c
@@ -63,6 +63,7 @@ static const char sccsid[] = "@(#)cut.c 8.3 (Berkeley) 5/4/95";
#include "builtins.h"
#include "shell.h"
#include "bashgetopt.h"
+#include "common.h"
#if !defined (errno)
extern int errno;
@@ -359,6 +360,8 @@ _cut_strsep(stringp, delim)
}
static char *cut_doc[] = {
+ "Select portions of lines.",
+ "",
"Select portions of each line (as specified by LIST) from each FILE",
"(by default, the standard input), and write them to the standard output.",
"Items specified by LIST are either column positions or fields delimited",
diff --git a/examples/loadables/dirname.c b/examples/loadables/dirname.c
index 6159560..0f30286 100644
--- a/examples/loadables/dirname.c
+++ b/examples/loadables/dirname.c
@@ -2,6 +2,24 @@
/* See Makefile for compilation details. */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include "config.h"
#if defined (HAVE_UNISTD_H)
@@ -11,6 +29,7 @@
#include <stdio.h>
#include "builtins.h"
#include "shell.h"
+#include "common.h"
dirname_builtin (list)
WORD_LIST *list;
@@ -78,6 +97,8 @@ dirname_builtin (list)
}
char *dirname_doc[] = {
+ "Display directory portion of pathname.",
+ "",
"The STRING is converted to the name of the directory containing",
"the filename corresponding to the last pathname component in STRING.",
(char *)NULL
diff --git a/examples/loadables/finfo.c b/examples/loadables/finfo.c
index c1682ed..af7ffb6 100644
--- a/examples/loadables/finfo.c
+++ b/examples/loadables/finfo.c
@@ -1,5 +1,8 @@
/*
* finfo - print file info
+ *
+ * Chet Ramey
+ * chet@po.cwru.edu
*/
#ifdef HAVE_CONFIG_H
@@ -12,6 +15,7 @@
#include <pwd.h>
#include <grp.h>
#include <errno.h>
+#include "posixtime.h"
#include "bashansi.h"
#include "shell.h"
@@ -353,7 +357,7 @@ int flags;
else
printf("%d\n", st->st_gid);
} else if (flags & OPT_SIZE)
- printf("%ld\n", st->st_size);
+ printf("%ld\n", (long) st->st_size);
return (0);
}
@@ -375,6 +379,8 @@ finfo_builtin(list)
}
static char *finfo_doc[] = {
+ "Display information about file attributes.",
+ "",
"Display information about each FILE. Only single operators should",
"be supplied. If no options are supplied, a summary of the info",
"available about each FILE is printed. If FILE is of the form",
diff --git a/examples/loadables/getconf.c b/examples/loadables/getconf.c
index 0bf2079..d3dec41 100644
--- a/examples/loadables/getconf.c
+++ b/examples/loadables/getconf.c
@@ -1343,6 +1343,8 @@ getconf_one(list)
}
static char *getconf_doc[] = {
+ "Display values of system limits and options.",
+ "",
"getconf writes the current value of a configurable system limit or",
"option variable to the standard output.",
(char *)NULL
diff --git a/examples/loadables/head.c b/examples/loadables/head.c
index 9052689..22cf6ab 100644
--- a/examples/loadables/head.c
+++ b/examples/loadables/head.c
@@ -2,6 +2,24 @@
/* See Makefile for compilation details. */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include "config.h"
#include "bashtypes.h"
@@ -21,6 +39,7 @@
#include "builtins.h"
#include "shell.h"
#include "bashgetopt.h"
+#include "common.h"
#if !defined (errno)
extern int errno;
@@ -127,6 +146,8 @@ head_builtin (list)
}
char *head_doc[] = {
+ "Display lines from beginning of file.",
+ "",
"Copy the first N lines from the input files to the standard output.",
"N is supplied as an argument to the `-n' option. If N is not given,",
"the first ten lines are copied.",
diff --git a/examples/loadables/hello.c b/examples/loadables/hello.c
index 1d68c6f..bff6e76 100644
--- a/examples/loadables/hello.c
+++ b/examples/loadables/hello.c
@@ -41,8 +41,11 @@ hello_builtin (list)
}
/* An array of strings forming the `long' documentation for a builtin xxx,
- which is printed by `help xxx'. It must end with a NULL. */
+ which is printed by `help xxx'. It must end with a NULL. By convention,
+ the first line is a short description. */
char *hello_doc[] = {
+ "Sample builtin.",
+ "",
"this is the long doc for the sample hello builtin",
(char *)NULL
};
diff --git a/examples/loadables/id.c b/examples/loadables/id.c
index 945190d..8773349 100644
--- a/examples/loadables/id.c
+++ b/examples/loadables/id.c
@@ -9,6 +9,24 @@
* uid=xxx(chet) gid=xx groups=aa(aname), bb(bname), cc(cname)
*/
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#include <stdio.h>
#include "bashtypes.h"
@@ -294,7 +312,9 @@ id_prall (uname)
}
char *id_doc[] = {
- "return information about user identity",
+ "Display information about user."
+ "",
+ "Return information about user identity",
(char *)NULL
};
diff --git a/examples/loadables/ln.c b/examples/loadables/ln.c
index e3234e3..ec73636 100644
--- a/examples/loadables/ln.c
+++ b/examples/loadables/ln.c
@@ -2,6 +2,24 @@
/* See Makefile for compilation details. */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include "config.h"
#include "bashtypes.h"
@@ -18,6 +36,7 @@
#include "builtins.h"
#include "shell.h"
#include "bashgetopt.h"
+#include "common.h"
#if !defined (errno)
extern int errno;
@@ -186,6 +205,8 @@ dolink (src, dst, flags)
}
char *ln_doc[] = {
+ "Link files.",
+ "",
"Create a new directory entry with the same modes as the original",
"file. The -f option means to unlink any existing file, permitting",
"the link to occur. The -s option means to create a symbolic link.",
diff --git a/examples/loadables/logname.c b/examples/loadables/logname.c
index 00cfd19..95b7e21 100644
--- a/examples/loadables/logname.c
+++ b/examples/loadables/logname.c
@@ -1,5 +1,23 @@
/* logname - print login name of current user */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#if defined (HAVE_UNISTD_H)
@@ -11,6 +29,7 @@
#include "builtins.h"
#include "shell.h"
+#include "common.h"
#if !defined (errno)
extern int errno;
@@ -35,7 +54,9 @@ logname_builtin (list)
}
char *logname_doc[] = {
- "write the current user's login name to the standard output",
+ "Display user login name.",
+ "",
+ "Write the current user's login name to the standard output",
"and exit. logname ignores the LOGNAME and USER variables.",
"logname ignores any non-option arguments.",
(char *)NULL
diff --git a/examples/loadables/mkdir.c b/examples/loadables/mkdir.c
index cd6e5f9..f41f171 100644
--- a/examples/loadables/mkdir.c
+++ b/examples/loadables/mkdir.c
@@ -2,6 +2,24 @@
/* See Makefile for compilation details. */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#include "bashtypes.h"
@@ -16,6 +34,7 @@
#include "builtins.h"
#include "shell.h"
#include "bashgetopt.h"
+#include "common.h"
#if !defined (errno)
extern int errno;
@@ -191,6 +210,8 @@ make_path (path, nmode, parent_mode)
}
char *mkdir_doc[] = {
+ "Create directories.",
+ "",
"Make directories. Create the directories named as arguments, in",
"the order specified, using mode rwxrwxrwx as modified by the current",
"umask (see `help umask'). The -m option causes the file permission",
diff --git a/examples/loadables/mypid.c b/examples/loadables/mypid.c
new file mode 100644
index 0000000..135cdb3
--- /dev/null
+++ b/examples/loadables/mypid.c
@@ -0,0 +1,74 @@
+/* This module should be dynamically loaded with enable -f
+ * which would create a new builtin named mypid. You'll need
+ * the source code for GNU bash to recompile this module.
+ *
+ * Then, from within bash, enable -f ./mypid enable_mypid, where ./mypid
+ * is the binary obtained from running make. Hereafter, `${MYPID}'
+ * is a shell builtin variable.
+ */
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
+#include "builtins.h"
+#include "shell.h"
+
+#define INIT_DYNAMIC_VAR(var, val, gfunc, afunc) \
+ do \
+ { SHELL_VAR *v = bind_variable (var, (val), 0); \
+ v->dynamic_value = gfunc; \
+ v->assign_func = afunc; \
+ } \
+ while (0)
+
+static SHELL_VAR *
+assign_mypid (
+ SHELL_VAR *self,
+ char *value,
+ arrayind_t unused,
+ char *key )
+{
+ return (self);
+}
+
+static SHELL_VAR *
+get_mypid (SHELL_VAR *var)
+{
+ int rv;
+ char *p;
+
+ rv = getpid();
+ p = itos (rv);
+
+ FREE (value_cell (var));
+
+ VSETATTR (var, att_integer);
+ var_setvalue (var, p);
+ return (var);
+}
+
+int
+enable_mypid_builtin(WORD_LIST *list)
+{
+ INIT_DYNAMIC_VAR ("MYPID", (char *)NULL, get_mypid, assign_mypid);
+
+ return 0;
+}
+
+char const *enable_mypid_doc[] = {
+ "Enable $MYPID.",
+ "",
+ "Enables use of the ${MYPID} dynamic variable. ",
+ "It will yield the current pid of a subshell.",
+ (char *)0
+};
+
+struct builtin enable_mypid_struct = {
+ "enable_mypid",
+ enable_mypid_builtin,
+ BUILTIN_ENABLED,
+ (char**)(void*)enable_mypid_doc,
+ "enable_mypid N",
+ 0
+};
diff --git a/examples/loadables/necho.c b/examples/loadables/necho.c
index 521ee2c..b567389 100644
--- a/examples/loadables/necho.c
+++ b/examples/loadables/necho.c
@@ -3,6 +3,24 @@
/* Sample builtin to be dynamically loaded with enable -f and replace an
existing builtin. */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include "builtins.h"
#include "shell.h"
@@ -17,6 +35,8 @@ WORD_LIST *list;
}
char *necho_doc[] = {
+ "Display arguments.",
+ "",
"Print the arguments to the standard ouput separated",
"by space characters and terminated with a newline.",
(char *)NULL
diff --git a/examples/loadables/pathchk.c b/examples/loadables/pathchk.c
index 2e36f8f..c5fd24a 100644
--- a/examples/loadables/pathchk.c
+++ b/examples/loadables/pathchk.c
@@ -22,6 +22,24 @@
/* See Makefile for compilation details. */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#include <sys/types.h>
@@ -45,6 +63,7 @@
#include "stdc.h"
#include "bashgetopt.h"
#include "maxpath.h"
+#include "common.h"
#if !defined (errno)
extern int errno;
@@ -112,6 +131,8 @@ pathchk_builtin (list)
}
char *pathchk_doc[] = {
+ "Check pathnames for validity.",
+ "",
"Check each pathname argument for validity (i.e., it may be used to",
"create or access a file without casuing syntax errors) and portability",
"(i.e., no filename truncation will result). If the `-p' option is",
diff --git a/examples/loadables/perl/Makefile.in b/examples/loadables/perl/Makefile.in
index 3af9b85..d8860bd 100644
--- a/examples/loadables/perl/Makefile.in
+++ b/examples/loadables/perl/Makefile.in
@@ -2,31 +2,33 @@
# Makefile for builtin perl interpreter
#
#
-# Copyright (C) 1998 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
+# Copyright (C) 1998 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
# Include some boilerplate Gnu makefile definitions.
prefix = @prefix@
-
exec_prefix = @exec_prefix@
+
bindir = @bindir@
libdir = @libdir@
infodir = @infodir@
includedir = @includedir@
+datarootdir = @datarootdir@
+
topdir = @top_srcdir@
BUILD_DIR = @BUILD_DIR@
srcdir = @srcdir@
diff --git a/examples/loadables/print.c b/examples/loadables/print.c
index ad658a7..e17597b 100644
--- a/examples/loadables/print.c
+++ b/examples/loadables/print.c
@@ -2,6 +2,24 @@
* print -- loadable ksh-93 style print builtin
*/
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -17,6 +35,8 @@
#include "builtins.h"
#include "stdc.h"
#include "bashgetopt.h"
+#include "builtext.h"
+#include "common.h"
#if !defined (errno)
extern int errno;
@@ -30,6 +50,8 @@ static FILE *ofp;
extern char *this_command_name;
static char *print_doc[] = {
+ "Display arguments.",
+ "",
"Output the arguments. The -f option means to use the argument as a",
"format string as would be supplied to printf(1). The rest of the",
"options are as in ksh.",
diff --git a/examples/loadables/printenv.c b/examples/loadables/printenv.c
index 16f398f..8d3a05d 100644
--- a/examples/loadables/printenv.c
+++ b/examples/loadables/printenv.c
@@ -5,12 +5,31 @@
*
*/
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#include <stdio.h>
#include "builtins.h"
#include "shell.h"
#include "bashgetopt.h"
+#include "common.h"
extern char **export_env;
@@ -53,11 +72,14 @@ printenv_builtin (list)
else
print_var_value (var, 0);
+ printf("\n");
return (EXECUTION_SUCCESS);
}
char *printenv_doc[] = {
- "print values of environment variables",
+ "Display environment.",
+ "",
+ "Print names and values of environment variables",
(char *)NULL
};
diff --git a/examples/loadables/push.c b/examples/loadables/push.c
index 497ecd0..b076073 100644
--- a/examples/loadables/push.c
+++ b/examples/loadables/push.c
@@ -3,6 +3,24 @@
*
*/
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#include <stdio.h>
#include <errno.h>
@@ -11,6 +29,7 @@
#include "shell.h"
#include "jobs.h"
#include "bashgetopt.h"
+#include "common.h"
#ifndef errno
extern int errno;
@@ -78,6 +97,8 @@ push_builtin (list)
}
char *push_doc[] = {
+ "Create child shell.",
+ "",
"Create a child that is an exact duplicate of the running shell",
"and wait for it to exit. The $SHLVL, $!, $$, and $PPID variables",
"are adjusted in the child. The return value is the exit status",
diff --git a/examples/loadables/realpath.c b/examples/loadables/realpath.c
index 16478b7..ffcbef8 100644
--- a/examples/loadables/realpath.c
+++ b/examples/loadables/realpath.c
@@ -18,6 +18,24 @@
* chet@po.cwru.edu
*/
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include "config.h"
#include <sys/types.h>
@@ -34,6 +52,7 @@
#include "builtins.h"
#include "shell.h"
#include "bashgetopt.h"
+#include "common.h"
#ifndef errno
extern int errno;
@@ -67,14 +86,14 @@ WORD_LIST *list;
vflag = 1;
break;
default:
- usage();
+ builtin_usage();
}
}
list = loptend;
if (list == 0)
- usage();
+ builtin_usage();
for (es = EXECUTION_SUCCESS; list; list = list->next) {
p = list->word->word;
@@ -101,6 +120,8 @@ WORD_LIST *list;
}
char *realpath_doc[] = {
+ "Display pathname in canonical form.",
+ "",
"Display the canonicalized version of each PATHNAME argument, resolving",
"symbolic links. The -c option checks whether or not each resolved name",
"exists. The -s option produces no output; the exit status determines the",
diff --git a/examples/loadables/rmdir.c b/examples/loadables/rmdir.c
index 8d0f06a..0cfe6c7 100644
--- a/examples/loadables/rmdir.c
+++ b/examples/loadables/rmdir.c
@@ -2,12 +2,31 @@
/* See Makefile for compilation details. */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include "config.h"
#include <stdio.h>
#include <errno.h>
#include "builtins.h"
#include "shell.h"
+#include "common.h"
#if !defined (errno)
extern int errno;
@@ -33,6 +52,8 @@ rmdir_builtin (list)
}
char *rmdir_doc[] = {
+ "Remove directory.",
+ "",
"rmdir removes the directory entry specified by each argument,",
"provided the directory is empty.",
(char *)NULL
diff --git a/examples/loadables/sleep.c b/examples/loadables/sleep.c
index 10a62cf..a9bd36f 100644
--- a/examples/loadables/sleep.c
+++ b/examples/loadables/sleep.c
@@ -3,6 +3,25 @@
*
* usage: sleep seconds[.fraction]
*/
+
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include "config.h"
#include "bashtypes.h"
@@ -27,6 +46,7 @@
#include "shell.h"
#include "builtins.h"
+#include "common.h"
#define RETURN(x) \
do { \
@@ -35,77 +55,6 @@
return (x); \
} while (0)
-#if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT)
-static int
-fsleep(sec, usec)
-long sec, usec;
-{
- struct timeval tv;
-
- tv.tv_sec = sec;
- tv.tv_usec = usec;
-
- return select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &tv);
-}
-#else /* !HAVE_TIMEVAL || !HAVE_SELECT */
-static int
-fsleep(sec, usec)
-long sec, usec;
-{
- if (usec >= 500000) /* round */
- sec++;
- return (sleep(sec));
-}
-#endif /* !HAVE_TIMEVAL || !HAVE_SELECT */
-
-/*
- * An incredibly simplistic floating point converter.
- */
-static int multiplier[7] = { 1, 100000, 10000, 1000, 100, 10, 1 };
-
-static int
-convert(s, sp, usp)
-char *s;
-long *sp, *usp;
-{
- int n;
- long sec, usec;
- char *p;
-
- sec = usec = 0;
-
-#define DECIMAL '.'
-
- for (p = s; p && *p; p++) {
- if (*p == DECIMAL) /* decimal point */
- break;
- if (DIGIT(*p) == 0)
- RETURN(0);
- sec = (sec * 10) + (*p - '0');
- }
-
- if (*p == 0)
- RETURN(1);
-
- if (*p == DECIMAL)
- p++;
-
- /* Look for up to six digits past a decimal point. */
- for (n = 0; n < 6 && p[n]; n++) {
- if (DIGIT(p[n]) == 0)
- RETURN(0);
- usec = (usec * 10) + (p[n] - '0');
- }
-
- /* Now convert to millionths */
- usec *= multiplier[n];
-
- if (n == 6 && p[6] >= '5' && p[6] <= '9')
- usec++; /* round up 1 */
-
- RETURN(1);
-}
-
int
sleep_builtin (list)
WORD_LIST *list;
@@ -122,7 +71,7 @@ WORD_LIST *list;
return (EX_USAGE);
}
- if (convert(list->word->word, &sec, &usec)) {
+ if (uconvert(list->word->word, &sec, &usec)) {
fsleep(sec, usec);
return(EXECUTION_SUCCESS);
}
@@ -132,6 +81,8 @@ WORD_LIST *list;
}
static char *sleep_doc[] = {
+ "Suspend execution for specified period.",
+ ""
"sleep suspends execution for a minimum of SECONDS[.FRACTION] seconds.",
(char *)NULL
};
diff --git a/examples/loadables/strftime.c b/examples/loadables/strftime.c
index 92f489e..2de09e3 100644
--- a/examples/loadables/strftime.c
+++ b/examples/loadables/strftime.c
@@ -2,6 +2,24 @@
/* See Makefile for compilation details. */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#if defined (HAVE_UNISTD_H)
@@ -85,6 +103,8 @@ strftime_builtin (list)
/* An array of strings forming the `long' documentation for a builtin xxx,
which is printed by `help xxx'. It must end with a NULL. */
char *strftime_doc[] = {
+ "Display formatted time.",
+ "",
"Converts date and time format to a string and displays it on the",
"standard output. If the optional second argument is supplied, it",
"is used as the number of seconds since the epoch to use in the",
diff --git a/examples/loadables/sync.c b/examples/loadables/sync.c
index 44d4e09..d91852e 100644
--- a/examples/loadables/sync.c
+++ b/examples/loadables/sync.c
@@ -1,5 +1,23 @@
/* sync - sync the disks by forcing pending filesystem writes to complete */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#ifdef HAVE_UNISTD_H
@@ -18,7 +36,9 @@ sync_builtin (list)
}
char *sync_doc[] = {
- "force completion of pending disk writes",
+ "Sync disks.",
+ ""
+ "Force completion of pending disk writes",
(char *)NULL
};
diff --git a/examples/loadables/tee.c b/examples/loadables/tee.c
index 934abda..8b5715f 100644
--- a/examples/loadables/tee.c
+++ b/examples/loadables/tee.c
@@ -2,6 +2,24 @@
/* See Makefile for compilation details. */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include "config.h"
#include "bashtypes.h"
@@ -22,6 +40,7 @@
#include "builtins.h"
#include "shell.h"
#include "bashgetopt.h"
+#include "common.h"
#if !defined (errno)
extern int errno;
@@ -140,6 +159,8 @@ tee_builtin (list)
}
char *tee_doc[] = {
+ "Duplicate standard output.",
+ "",
"Copy standard input to standard output, making a copy in each",
"filename argument. If the `-a' option is gived, the specified",
"files are appended to, otherwise they are overwritten. If the",
diff --git a/examples/loadables/template.c b/examples/loadables/template.c
index 7bb3f9f..3a5814f 100644
--- a/examples/loadables/template.c
+++ b/examples/loadables/template.c
@@ -43,6 +43,9 @@ template_builtin (list)
}
char *template_doc[] = {
+ "Short description.",
+ ""
+ "Longer description of builtin and usage.",
(char *)NULL
};
diff --git a/examples/loadables/truefalse.c b/examples/loadables/truefalse.c
index e77c74c..113e88f 100644
--- a/examples/loadables/truefalse.c
+++ b/examples/loadables/truefalse.c
@@ -1,8 +1,29 @@
/* true and false builtins */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <config.h>
+
#include "bashtypes.h"
#include "shell.h"
#include "builtins.h"
+#include "common.h"
true_builtin (list)
WORD_LIST *list;
@@ -17,11 +38,15 @@ false_builtin (list)
}
static char *true_doc[] = {
+ "Exit successfully.",
+ "",
"Return a successful result.",
(char *)NULL
};
static char *false_doc[] = {
+ "Exit unsuccessfully.",
+ "",
"Return an unsuccessful result.",
(char *)NULL
};
diff --git a/examples/loadables/tty.c b/examples/loadables/tty.c
index 2183123..1d88506 100644
--- a/examples/loadables/tty.c
+++ b/examples/loadables/tty.c
@@ -2,12 +2,31 @@
/* See Makefile for compilation details. */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include "config.h"
#include <stdio.h>
#include "builtins.h"
#include "shell.h"
#include "bashgetopt.h"
+#include "common.h"
extern char *ttyname ();
@@ -40,6 +59,8 @@ tty_builtin (list)
}
char *tty_doc[] = {
+ "Display terminal name.",
+ "",
"tty writes the name of the terminal that is opened for standard",
"input to standard output. If the `-s' option is supplied, nothing",
"is written; the exit status determines whether or not the standard",
diff --git a/examples/loadables/uname.c b/examples/loadables/uname.c
index 9f450cd..a1bddd5 100644
--- a/examples/loadables/uname.c
+++ b/examples/loadables/uname.c
@@ -5,6 +5,24 @@
*
*/
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#include <stdio.h>
@@ -27,6 +45,7 @@ struct utsname {
#include "builtins.h"
#include "shell.h"
#include "bashgetopt.h"
+#include "common.h"
#define FLAG_SYSNAME 0x01 /* -s */
#define FLAG_NODENAME 0x02 /* -n */
@@ -125,7 +144,9 @@ uprint (flag, info)
}
char *uname_doc[] = {
- "display information about the system",
+ "Display system information.",
+ "",
+ "Display information about the system hardware and OS.",
(char *)NULL
};
diff --git a/examples/loadables/unlink.c b/examples/loadables/unlink.c
index 8c81ad0..07e3f3d 100644
--- a/examples/loadables/unlink.c
+++ b/examples/loadables/unlink.c
@@ -3,6 +3,24 @@
/* Should only be used to remove directories by a superuser prepared to let
fsck clean up the file system. */
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#ifdef HAVE_UNISTD_H
@@ -14,6 +32,7 @@
#include "builtins.h"
#include "shell.h"
+#include "common.h"
#ifndef errno
extern int errno;
@@ -39,6 +58,8 @@ unlink_builtin (list)
char *unlink_doc[] = {
"Remove a directory entry.",
+ "",
+ "Forcibly remove a directory entry, even if it's a directory.",
(char *)NULL
};
diff --git a/examples/loadables/whoami.c b/examples/loadables/whoami.c
index 41fd5c4..6f8471a 100644
--- a/examples/loadables/whoami.c
+++ b/examples/loadables/whoami.c
@@ -2,12 +2,31 @@
* whoami - print out username of current user
*/
+/*
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#include <stdio.h>
#include "builtins.h"
#include "shell.h"
#include "bashgetopt.h"
+#include "common.h"
whoami_builtin (list)
WORD_LIST *list;
@@ -38,7 +57,9 @@ whoami_builtin (list)
}
char *whoami_doc[] = {
- "display name of current user",
+ "Print user name",
+ "",
+ "Display name of current user.",
(char *)NULL
};