Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks, It is very cool. I really donot know `which` does not write to stderr.


When you are not sure and don't want to waste your time investigating, you can do &>/dev/null in bash and get rid of them both at the same time.


... But only in Bash 4. This doesn't appear to work with stock OS X (Bash 3).


  Betty:srcs lelf$ perl -E 'say "out"; say STDERR "err";' &> out && cat out
  err
  out
  Betty:srcs lelf$
  GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: