Sponsored Content
Top Forums Shell Programming and Scripting <Mail> attachment param is not working under system function Post 303025240 by reminisce on Monday 29th of October 2018 07:36:06 AM
Old 10-29-2018
<Mail> attachment param is not working under system function

Hi Guys,


I have executed the mail command that has attachment with filename as current date enclosed in system function that is added under awk command.
I have used awk command to check if the error code is present in the file then email command sends an email with subject Error Code ,body provided in the file 'mailmessage.txt' and attachment of current date file .


Code:
awk '{if ($1 ~ /BIP8071I/)  {
DATE="`date '+%d%m%Y'`"
system("mail -s" $1 "test\\ "Information"\ emailid -a /home/test/abc_$DATE.txt <  /home/test/mailmessage.txt")
}


This command has executed without any flaws. But when I received the email, I didn't find the attachment . Instead, the -a parameter is coming in to section of the email box as provided in the attachment.
&lt;Mail&gt; attachment param is not working under system function-27th-oct-emailpng

Can anyone suggest if this can be possible in system function.


Thanks.




Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 10-29-2018 at 09:30 AM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

mailx commannd - Mail and Attachment in same mail

Hi , I am using mailx command for sending the mails. Rightnow I am sending the attachment (by using uuencode $filename) as a seperate mail.I wanna send the attachment also with the same mail. (6 Replies)
Discussion started by: sharif
6 Replies

2. Shell Programming and Scripting

Mail attachment with unix mail

Hi Could someone help me with the details on how to send an attachment through mail in unix. I have an html file in my unix machine and I want this to be send to some mail id, plese help with the steps. Regards Ajay (2 Replies)
Discussion started by: ajaykumarboyana
2 Replies

3. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

4. Shell Programming and Scripting

Need help on bind param function in perl

Hi, I want to know what exactly bind paameter does? what exactly bind_param( 1, $siteName ) means? what 1 means? In some examples the bind_param is set like this: bind_param( 2, $siteName1 ) bind_param( 3, $siteName2 ) $sth = $dbh->prepare( " SELECT name,... (1 Reply)
Discussion started by: vanitham
1 Replies

5. Shell Programming and Scripting

mail function - script not working

#!/bin/bash { m() $mail='("$someemail@gmail.com ", Cc:"$me" -t, Subject:"$emailmyself" -s, $someinputfile")' } what I am trying to do is create a function have it load when type the letter "m" so all have to do type an address after it send email. it tell me syntax on line 4 but which... (2 Replies)
Discussion started by: ericde
2 Replies

6. Web Development

CGI param() function parameters

Hello again! Three posts in this forum now, as I am trying to understand how CGI is running and the interaction of the input and output with the server/browser. Very confused with them, especially with the param() function that I was trying to figure out how the parameters of it were passed in... (0 Replies)
Discussion started by: yifangt
0 Replies

7. Shell Programming and Scripting

Mail Attachment...

Hi All, I am new to unix. I have written the script to identify the delimiter count for my source file and the output I have to capture in another file and that file should sent to mail with attachment. I have tried to send the attachment with below script . But I am not able to do that. Any... (2 Replies)
Discussion started by: suresh_target
2 Replies

8. Shell Programming and Scripting

Mail Attachment Not Working for Cron

Hi All, i Have An Script Which is Fetching Data From DB And sending Mail With the Data in Excel Format. i'm Receiving Mail with Attachment when i Manually Running the script using ksh -x Scriptname or ./ Scriptname. when i try to run it through cron i'm receiving mail only but ... (7 Replies)
Discussion started by: naveen1.kumar
7 Replies

9. Shell Programming and Scripting

How to send mail using PHP mail function On apache server.?

Hello, I am using centos-6.2 I have apache server,php5 on my system and I want to send mail using sendmail on my system. when I try to send mail from shell that time mail is succesfully sent to respective address() but when I try to send it through webbrowser I am not able to send it.... (1 Reply)
Discussion started by: Kiran ursal
1 Replies

10. Shell Programming and Scripting

Sending an email with mail function shows up as an attachment 'noname'

I have a file named email.html with this as the contents: Content-type: text/html ACHI,ACCRETIVE HEALTH ,7.15,<br>CPRT,Copart Inc.,36.14,<br>GEOB.MX,GEO-B,1.660,<br>GCO,Genesco Inc. Comm,73.58,<br>GMAN,Gordmans Stores, ,<br>GES,Guess? Inc. Comm,26.45,<br>KBR,KBR Inc. Common... (1 Reply)
Discussion started by: phpchick
1 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 02:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy