Skip to main content
1 of 3
AProgrammer
  • 2.4k
  • 18
  • 17

Setting verbose option for at(1) and batch(1) commands

I'm trying to set automatically the verbose and xtrace options for shells which are reading their commands from a standard input which is not connected to a terminal (that test is a proxy for being executed by the at(1) and batch(1) commands, if there is a better one it would be acceptable as well).

I'd have though that

if [[ -o SHIN_STDIN ]] && ! test -t 0 ; then
    PS4="> "
    setopt verbose xtrace
fi

in my .zshenv would do the trick but that's not the case although I've checked that the .zshenv is indeed correctly executed and that when launching [[ -o SHIN_STDIN ]] && !test -t 0 && echo OK with batch I get the expected email.

What am I missing?

AProgrammer
  • 2.4k
  • 18
  • 17