Fix warning “stdin: is not a tty” when using scp to CPanel server

When I setup some maintenance scripts, I needed to copy some files from our CPanel servers to a central server for processing.

After it was all setup, I discovered the server was sending an email with every crontab on the central server that only had one line of text:

stdin: is not a tty

After some research, I found the solution was to add the following to the beginning of the ~/.bashrc file:


# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac