when i write bash the output appear on th screen ....i don't want to display the command and the command output on screen how i can do it ?
2 Answers
somecommand &> /dev/null
-
thank you it is work ... but if you know how i can do this on windows CMD Oct 5, 2010 at 7:48
-
-
i try it but it is effect on the exit code (return value of the batch in windows) Oct 5, 2010 at 8:03
-
@Osama: If you want to dump
stderr
as well asstdout
, use something likesomecommand > NUL 2>&1
-- This will redirect console output but the command will still populate%ERRORLEVEL%
with exit code.– jscottOct 5, 2010 at 9:28 -
In windows, you can use NUL
as in:
somecommand > NUL
(Please change the tags to reflect that this is actually a Windows, not unix/bash question)