summaryrefslogtreecommitdiffstats
path: root/bin/sh
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>1999-04-03 11:41:46 +0000
committercracauer <cracauer@FreeBSD.org>1999-04-03 11:41:46 +0000
commitaffd55a23b9e3a35ceccf2ae330484d3cd15000d (patch)
tree7ff31bdd5007ab0b14f7470bd039e26095989e30 /bin/sh
parenta60072138b1bbfc03a9f8a531afefbd6993819e6 (diff)
downloadFreeBSD-src-affd55a23b9e3a35ceccf2ae330484d3cd15000d.zip
FreeBSD-src-affd55a23b9e3a35ceccf2ae330484d3cd15000d.tar.gz
Implement -a flag. A test shell script can be found at
http://www.cons.org/cracauer/download/sh-interrupt/testsuite/test_export.sh The PR also had test cases the new version passes. Fix typo in comment. PR: bin/1030
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/sh.13
-rw-r--r--bin/sh/var.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
index 5d5690a..423edb9 100644
--- a/bin/sh/sh.1
+++ b/bin/sh/sh.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
-.\" $Id: sh.1,v 1.25 1999/04/01 13:27:36 cracauer Exp $
+.\" $Id: sh.1,v 1.26 1999/04/02 09:28:00 cracauer Exp $
.\"
.Dd May 5, 1995
.Dt SH 1
@@ -150,7 +150,6 @@ words on the command line to be treated as arguments.
.Bl -tag -width Ds
.It Fl a Li allexport
Export all variables assigned to.
-.Pq UNIMPLEMENTED
.It Fl b Li notify
Enable asynchronous notification of background job
completion.
diff --git a/bin/sh/var.c b/bin/sh/var.c
index d1f2b76..9b9f0ee 100644
--- a/bin/sh/var.c
+++ b/bin/sh/var.c
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: var.c,v 1.12 1998/05/18 06:44:24 charnier Exp $";
#endif /* not lint */
#include <unistd.h>
@@ -218,7 +218,7 @@ setvarsafe(name, val, flags)
}
/*
- * Set the value of a variable. The flags argument is ored with the
+ * Set the value of a variable. The flags argument is stored with the
* flags of the variable. If val is NULL, the variable is unset.
*/
@@ -302,6 +302,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)) {
OpenPOWER on IntegriCloud