I have several shell scripts (bash) which are started by cron. Every time a script is executed I get an email saying "stdin: is not a tty". Can someone please tell me how to fix this? All scripts run successfully but these mails are killing my email folder.
I use Debian Wheezy. "/root/.bashrc" is empty. Cron entries are like:
/bin/bash --login /root/script.sh > /dev/null
Even this script produces the error message:
#!/bin/bash
ls
Content of .profile:
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
mesg n
.profile
or.bash_profile
since you're telling bash to read it). We can't help you unless you post the script content. If you want to diagnose what it might be, addset -x
at the top of the script. – Gilles 'SO- stop being evil' Jan 16 '14 at 0:45stty
andmesg
are the typical culprits. You can run them with a2>/dev/null
to quiet them. – Mark Plotnick Jan 16 '14 at 1:07mesg
. – Mark Plotnick Jan 16 '14 at 1:22