0

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 2

2
somecommand &> /dev/null
7
  • thank you it is work ... but if you know how i can do this on windows CMD Oct 5, 2010 at 7:48
  • somecommand > NUL, I think. Oct 5, 2010 at 7:50
  • 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 as stdout, use something like somecommand > NUL 2>&1 -- This will redirect console output but the command will still populate %ERRORLEVEL% with exit code.
    – jscott
    Oct 5, 2010 at 9:28
  • @jscott: When was FD redirection added to cmd.exe? Oct 5, 2010 at 9:34
0

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)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .