% set verbose echo

% echo foo >& bar
% cat bar
guess what you get:
echo foo
foo
This commit is contained in:
christos 2002-03-08 17:15:30 +00:00
parent 5d5763b4f5
commit 971f33821d
2 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: csh.c,v 1.28 2001/09/16 12:20:33 wiz Exp $ */
/* $NetBSD: csh.c,v 1.29 2002/03/08 17:15:30 christos Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1991, 1993\n\
#if 0
static char sccsid[] = "@(#)csh.c 8.2 (Berkeley) 10/12/93";
#else
__RCSID("$NetBSD: csh.c,v 1.28 2001/09/16 12:20:33 wiz Exp $");
__RCSID("$NetBSD: csh.c,v 1.29 2002/03/08 17:15:30 christos Exp $");
#endif
#endif /* not lint */
@ -1075,7 +1075,12 @@ process(bool catch)
* is a lexical error then we forego history echo.
*/
if ((lex(&paraml) && !seterr && intty) || adrof(STRverbose)) {
int odidfds = didfds;
fflush(csherr);
didfds = 0;
prlex(csherr, &paraml);
fflush(csherr);
didfds = odidfds;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec.c,v 1.17 2001/11/03 13:35:39 lukem Exp $ */
/* $NetBSD: exec.c,v 1.18 2002/03/08 17:15:30 christos Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)exec.c 8.3 (Berkeley) 5/23/95";
#else
__RCSID("$NetBSD: exec.c,v 1.17 2001/11/03 13:35:39 lukem Exp $");
__RCSID("$NetBSD: exec.c,v 1.18 2002/03/08 17:15:30 christos Exp $");
#endif
#endif /* not lint */
@ -430,9 +430,14 @@ void
xechoit(Char **t)
{
if (adrof(STRecho)) {
int odidfds = didfds;
(void)fflush(csherr);
odidfds = didfds;
didfds = 0;
blkpr(csherr, t);
(void)fputc('\n', csherr);
(void)fflush(csherr);
didfds = odidfds;
}
}