Implement sh -a (allexport). Code (all two lines of it) from FreeBSD

(FreeBSD var.c 1.13, sh.1 1.27).
This commit is contained in:
bjh21 2002-05-15 19:43:29 +00:00
parent dada8613e1
commit 6f786375c4
2 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: sh.1,v 1.48 2002/05/15 16:33:35 christos Exp $
.\" $NetBSD: sh.1,v 1.49 2002/05/15 19:43:29 bjh21 Exp $
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@ -170,7 +170,7 @@ with the
builtin (described later).
.Bl -tag -width aaaallexportfoo -offset indent
.It Fl a Em allexport
Export all variables assigned to. (UNIMPLEMENTED for 4.4alpha)
Export all variables assigned to.
.It Fl c
Read commands from the command line.
No commands will be read from the standard input.

View File

@ -1,4 +1,4 @@
/* $NetBSD: var.c,v 1.27 2001/02/04 19:52:07 christos Exp $ */
/* $NetBSD: var.c,v 1.28 2002/05/15 19:43:29 bjh21 Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: var.c,v 1.27 2001/02/04 19:52:07 christos Exp $");
__RCSID("$NetBSD: var.c,v 1.28 2002/05/15 19:43:29 bjh21 Exp $");
#endif
#endif /* not lint */
@ -282,6 +282,8 @@ setvareq(s, flags)
{
struct var *vp, **vpp;
if (aflag)
flags |= VEXPORT;
vpp = hashvar(s);
for (vp = *vpp ; vp ; vp = vp->next) {
if (varequal(s, vp->text)) {