LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-13-2004, 10:10 PM   #1
chynna_v
LQ Newbie
 
Registered: Sep 2004
Posts: 13

Rep: Reputation: 0
Mail Function in bash scripting


hi everyone...

can someone tell me a link or a sample code the could use the mail function using bash scripting?

coz i try to..here is my code below..but it doesn't work..

#!/bin/sh
#!/bin/sh
echo [`date +%Y-%m-%d` `date +%k:%M:%S`] - TEST1
mail home@metest.com -s "Test2"
exit 0


thanks a lot!!
 
Old 09-14-2004, 12:05 AM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
try a pipe between the echo and mail. It works for me.
Code:
echo [`date +%Y-%m-%d` `date +%k:%M:%S`] - TEST1 | mail crabboy -s "test2"
 
Old 09-14-2004, 04:36 AM   #3
chynna_v
LQ Newbie
 
Registered: Sep 2004
Posts: 13

Original Poster
Rep: Reputation: 0
thanks! the pipe works...i think i might have overlook that part
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell scripting: how to load a function from a file? frankie_DJ Programming 2 08-16-2005 02:16 PM
Bash Scripting - Using a function as test. ldp Programming 1 01-04-2005 06:31 AM
Bash Scripting Darklight451 Programming 1 10-07-2004 01:48 AM
Bash Scripting Help Aioth Linux - Newbie 8 09-21-2004 11:21 AM
HELP with BASH scripting atwah Linux - Newbie 6 09-09-2003 01:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration