LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 07-27-2005, 11:20 AM   #1
ciccio81
LQ Newbie
 
Registered: Jul 2005
Posts: 4

Rep: Reputation: 0
Question info create script


Hi, i have need to send mail using a script in bash shell...but i don't know how i can do...so can some one help me... :sad: .
Thanks a lot bye bye
 
Old 07-27-2005, 11:50 AM   #2
vladmihaisima
Member
 
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196

Rep: Reputation: 33
You can use mail command (use "man mail", no I don't have time to write an example...)
 
Old 07-28-2005, 02:15 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Something along these lines should work :

echo $file $result >> myfile.log

# email results
mail -s "email_subject" me@a.com.au < myfile.log

HTH
 
Old 07-28-2005, 03:06 AM   #4
ciccio81
LQ Newbie
 
Registered: Jul 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks but i must send not one e-mail but 50 e-mails stored in a directory....so what can i do?
thanks a lot bye bye
 
Old 07-28-2005, 09:06 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
spammer?
 
Old 07-30-2005, 03:20 AM   #6
ciccio81
LQ Newbie
 
Registered: Jul 2005
Posts: 4

Original Poster
Rep: Reputation: 0
ok thanks
 
Old 07-30-2005, 03:28 AM   #7
ciccio81
LQ Newbie
 
Registered: Jul 2005
Posts: 4

Original Poster
Rep: Reputation: 0
i have a problem i have write this script
**************************************

#!/bin/bash
#use command mail for send a mail present in a directory

# i repeat this for how many e-mail are stored in my directory
# count number of file in directory
nummail= ls | wc -l
while [$nummail -gt 0]
do
email=$(ls ./email/*.eml | more)
nummail=' expr $nummail-1'
mail -s "PROVA PROVA "Administrator@dominio.loc < $(email)
done

***************************

i nummail i have the number of file in directory....but i don't know how i can extract the single name of file present in the directory and used in the var email in the command mail.

i hope i explain well the problem sorry for my English.
Thanks a lot.

P.S i'm not a spammer is for thesis at university
 
  


Reply



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
How do I get PID info about a specific script? Stepaj47 Linux - Newbie 2 11-14-2005 04:31 PM
Server info shell script? Rotwang Linux - General 2 10-10-2005 11:01 PM
how to create our own help info m.harshavardhan Linux - Software 0 08-25-2005 09:12 AM
how do i create a script unimaginative Linux - General 6 01-01-2004 06:53 PM
How do I create a script? ACURA TL-S Linux - Newbie 1 08-03-2003 09:58 PM

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

All times are GMT -5. The time now is 11:15 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