(Debian Squeeze)
I was working on a shell script that piped output to the mail command. I must have done something wrong, as I am no longer able to use the command for anything. Even if I type "mail" with no arguments, it just spits out what appears to be the content I previously tried to email, but it then just returns me to a prompt. The same output occurs regardless of which arguments I use with the command.
We do not use local mail storage, and I have deleted all of the user files in /var/mail and /var/spool/mail (one is a link to the other), but for the life of me, I cannot figure out how to get use of this command back.
I'm struggling with any kind of searching for this problem as the search terms seem way too vague.
I suspect that at some point you accidentally did something like:
instead of
thus replacing
/usr/bin/mail
with a copy of some data.I would suggest that you reinstall the mail program. Because Debian ships several alternatives, you can find the one you have installed with:
So the mail program is really
/usr/bin/bsd-mailx
on this system. Let us find out which package it came from:And finally we will reinstall that package.