Sponsored Content
Full Discussion: Send file content in mail
Top Forums UNIX for Beginners Questions & Answers Send file content in mail Post 302981703 by Scrutinizer on Sunday 18th of September 2016 01:32:45 AM
Old 09-18-2016
To get the output of a command in a variable, you need to use backquotes instead of quotes.
Code:
var=`some_command`

but it is better to use this:
Code:
var=$(some_command)

Also it is best to quote variable expansions:
Code:
cat "$FILE"

Code:
echo "$content"

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Send a mail with an attachement of a file

I wanted to try sending a mail with an attachement at command prompt in unix. Some one please advise that how we can do it ? Thanks, :) (2 Replies)
Discussion started by: gaddeg
2 Replies

2. UNIX for Dummies Questions & Answers

To send a mail with a file attached

Hi, Can anyone please tell me how to send a mail to a person in unix with a file attached. The file need to be zipped and then i want to send the mail to a person. I know that we can able to send mail from unix using the command mail mailaddress to send a mail to a person with the... (5 Replies)
Discussion started by: samudha
5 Replies

3. Shell Programming and Scripting

Pull E-mail address from file, send e-mail

Hello, I am new to perl and need to create a script that will read a file and pull a name from the file and send e-mail. How can I use the following awk statement in a perl script? grep UNIXadmins /root/mail.conf | awk '{ print $2}' and use the output to send a e-mail. Any help would... (1 Reply)
Discussion started by: DC Heard
1 Replies

4. UNIX for Dummies Questions & Answers

To send an email with the body content extracted from a file

Hi, I have been trying to shoot an email with the email body to be obtained from a file. Can someone please help me with it.. I have been trying to use the MAILX commad for the same. mailx -s "test email" -r sender@test.com < file.txt but it sends the file as an attachment,while i... (3 Replies)
Discussion started by: rohit.shetty84
3 Replies

5. UNIX for Dummies Questions & Answers

How to send file in mail

Hi I want to send out a file that generate 1st of each month that have formate like this 11012008_experience_rate_log.txt Now I have setup a cronjob that usually sent this file in mail like cat /data02/transfer/*_experience_rate_log.txt | mail -s 'PICS EXP RATE Logs' lger@bd.com So how... (3 Replies)
Discussion started by: vishalpatel03
3 Replies

6. 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

7. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

8. Shell Programming and Scripting

How to copy mail content in a file in Unix

Hi Guys I want to write a script which search mail with subject line and after that I want the mail content in a file please help guys. Thanks Atul Singh (3 Replies)
Discussion started by: atul9806
3 Replies

9. Shell Programming and Scripting

Shell script to monitor new file in a directory and mail the file content

Hi I am looking for a help in designing a bash script on linux which can do below:- 1) Look in a specific directory for any new files 2) Mail the content of the new file Appreciate any help Regards Neha (5 Replies)
Discussion started by: neha0785
5 Replies

10. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies
BIFF(1)                                                     BSD General Commands Manual                                                    BIFF(1)

NAME
biff -- be notified if mail arrives and who it is from SYNOPSIS
biff [ny] DESCRIPTION
Biff informs the system whether you want to be notified when mail arrives during the current terminal session. Options supported by biff: n Disables notification. y Enables notification. When mail notification is enabled, the header and first few lines of the message will be printed on your screen whenever mail arrives. A ``biff y'' command is often included in the file .login or .profile to be executed at each login. Biff operates asynchronously via the comsat(8) service. If that service is not enabled, biff will not do anything. In that case, or for syn- chronous notification, use the MAIL variable of sh(1) or the mail variable of csh(1). SEE ALSO
csh(1), mail(1), sh(1), comsat(8) HISTORY
The biff command appeared in 4.0BSD. BUGS
su(1), and biff don't seem to get on too well. This is probably due to the tty still being owned by the person using su. This can result in ``Permission denied'' messages when attempting to change the biff status of your session. Please report bugs to netbug@ftp.uk.linux.org including diffs/patches, compiler error logs or as complete a bug report as is possible. Linux NetKit (0.17-pre-20000412) July 31, 1999 Linux NetKit (0.17-pre-20000412)
All times are GMT -4. The time now is 10:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy