문제

I was wondering how I would suppress the following output.

commands will be executed using /bin/ksh
job ##########.a at Mon Mar ## ##:##:## 2014

when using the "at - k" command. I have tried using it like

at -k "now + 5 hours" <<! >/dev/null
something
!

but I keep getting the output. Any suggestions?

도움이 되었습니까?

해결책

at writes to stderr, not to stdout.

To redirect both, use the following:

at -k "now + 5 hours" <<! >/dev/null 2>&1
something
!

The 2>&1 tells the shell to redirect file descriptor 2 (stderr) to the same file as fd 1 (stdout).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top