Skip to content

Commit d55de70

Browse files
committed
Makefile: fix misdirected redirections
In general "echo 2>&1 $msg" to redirect a possible error message that comes from 'echo' itself into the same standard output stream $msg is getting written to does not make any sense; it is not like we are expecting to see any errors out of 'echo' in these statements, and even if it were the case, there is no reason to prevent the error messages from being sent to the standard error stream. These are clearly meant to send the argument given to echo to the standard error stream as error messages. Correctly redirect by saying "send what is written to the standard output to the standard error", i.e. "1>&2" aka ">&2". Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7654286 commit d55de70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,10 +2211,10 @@ sparse: $(SP_OBJ)
22112211
check: common-cmds.h
22122212
@if sparse; \
22132213
then \
2214-
echo 2>&1 "Use 'make sparse' instead"; \
2214+
echo >&2 "Use 'make sparse' instead"; \
22152215
$(MAKE) --no-print-directory sparse; \
22162216
else \
2217-
echo 2>&1 "Did you mean 'make test'?"; \
2217+
echo >&2 "Did you mean 'make test'?"; \
22182218
exit 1; \
22192219
fi
22202220

0 commit comments

Comments
 (0)