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
This commit is contained in:
parent
871b1fd2f0
commit
b8ec435e6b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=45263
@ -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.
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user