01-26-2005
mailx and awk- didn't find an answer KSH
Hi folks,
My input file's content:
You are line1
You are line2
You are line3
etc...
I need to write a script that for every line, it will send an e-mail and the body will hold the line:
Output(The e-mail that will be sent):
First e-mail: To: aaa Subject: bbb Body:You are line1
Second e-mail: To: aaa Subject: bbb Body:You are line2
and so one..
This is a part of ksh script and I find it hard to do it:
Can anyone assist me?
I wrote:
cat inputFile| awk '{print $0 >! tmp};{mailx -s 'Subject' 'aaa@hotmail.com' < ${tmp}") }'
But it doesn't work.
Thanks
10 More Discussions You Might Find Interesting
1. AIX
My root mail fills up very quickly because we have hundreds of remote printers and whenever a job is deleted, moved or a printer is down, up, sidways (jk) the queueing system drops root and email.
It fills up super fast and is causing a problem.
Rembak is the backend but i cannot find a way... (2 Replies)
Discussion started by: albertaguirre
2 Replies
2. Shell Programming and Scripting
Hi
I want to use mailx command to send a message included more than one file.
I tried to use uuencode in pipe but it could only generate one file.
I would avoid using an archive file :p
Thanks to read you.
Mathieu (2 Replies)
Discussion started by: madmat
2 Replies
3. UNIX for Advanced & Expert Users
I have read through all documents in FAQ and have run into an issue with sending an email with body message text and an email attachment. I have included what I have thus far and I can get the message body to send in the email to work only. I cannot understand the uuencode even after I read the... (5 Replies)
Discussion started by: tekline
5 Replies
4. Shell Programming and Scripting
Greetings all,
I'm pretty new to the use of mailx, having been using mutt most of the time. I'm interested to know how I can use mailx within a shell script to send out a formatted email with the following criterion:
1. My recipient's address is abcdef1000@gmail.com
2. The message body is... (2 Replies)
Discussion started by: rockysfr
2 Replies
5. Shell Programming and Scripting
Hi all,
Think this is a pretty simple problem, but I've been thinking about it for a few days. Let's say that I'm going to have to output the contents of a file as the body of a mailx message.
I'll probably do this: cat <filename> | mailx <extra commands>
However, how do I go about doing... (1 Reply)
Discussion started by: rockysfr
1 Replies
6. UNIX for Advanced & Expert Users
Hi Friends,
I have siebel installed in one of my aix machines and while opening a file it gives below error.
$ vi SmSiebelSSO.conf
History file has no read permission. q
Please note the file has rwxr-xr-x for oracle:dba and i am trying to open using oracle id itself which is the owner... (1 Reply)
Discussion started by: DJ2176
1 Replies
7. Shell Programming and Scripting
I want to filter 2nd column = 2 using awk
$ cat t
1 2
2 4
$ VAR=2
#variable worked in print
$ cat t | awk -v ID=$VAR ' { print ID}'
2
2
# but variable didn't work in awk filter
$ cat t | awk -v ID=$VAR '$2~/ID/ { print $0}' (2 Replies)
Discussion started by: honglus
2 Replies
8. Shell Programming and Scripting
Hi,
I need to create one KSH which will send mail to set of recipients using "mailx" command like below.
mailx -s "Test mail" "test@yahoo.com, test@gmail.com" <$output.txt
The recipients are in different domains (like yahoo, gmail, etc.).
My requirement is, if any mail is undelivered,... (1 Reply)
Discussion started by: Matrix2682
1 Replies
9. Shell Programming and Scripting
I am trying to run following script in ksh on darwin 11.4.2:
freeSpace=2469606195
spaceNeeded=200
] && echo "no space" || echo "space available"
] && echo "no space" || echo "space available"
"-lt" is giving wrong answer as "no space" Whereas '<' works fine. When I change the freespace... (4 Replies)
Discussion started by: sabitha
4 Replies
10. Post Here to Contact Site Administrators and Moderators
An 'addition' to the "Homework & Classes" requirements..
As i am someone without paper, i just figured i got tempred reading such a question.
To avoid such 'feelings' in future, i'd be thankfull if the 'kind & definition of the course' would be required too.
As in (i dont know about proper... (2 Replies)
Discussion started by: sea
2 Replies