• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to execute mail command in a shellscript  RSS feed

 
pavan bellari
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pls tell me how to excute mail command in shell script
i had given mail -s "hello raj" raj in shell,
where raj is username
but when i execute that script cursor is wainting for input until i press cntrl+d
But i have to send mail to a user in a shellscript not from the prompt
 
Lewin Chan
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

-t tells sendmail to read address information from the input stream, hence to To: and From: etc.
You will probalby have sendmail installed, it may not be in /usr/lib/sendmail though.
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you could try something like this, somewhere in a script:

Hope that helps.
[ October 31, 2003: Message edited by: George Brown ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!