Solved

Easy question

Posted on 2002-06-04
8
283 Views
Last Modified: 2010-04-21
How do I email myself a simple text file in UNIX.  For example I have a file called support.txt in a unix dir.  and I need it mailed to a address myself@company.com.  Please include the syntax and a good example.  I need send as a attachment  That would be nice.
0
Comment
Question by:UnixKid
  • 3
  • 3
  • 2
8 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7054119
0
 
LVL 38

Expert Comment

by:yuzh
ID: 7055173
You can use:

 mailx -s"Subject" your-email-add < inputfile

 where: your-email-add could be a list of email address seperate by ","

  eg:
  INFILE=/home/abc/support.txt
  mailx -s"This is support.txt" myself@company.com < ${INFILE}

  or

 you cab simple use mail:

 mail email-list < inputfile


 
0
 

Author Comment

by:UnixKid
ID: 7055416
Should the script look like the following message:

mailx -s"This is support.txt" vega1@uakron.edu < $/export/home/vega/test.txt

I try the following and it did not work, what I am I doing wrong
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 38

Accepted Solution

by:
yuzh earned 50 total points
ID: 7055479
if you are not using var for your file you should use put the following in your script:

/usr/bin/mailx -s"This is support.txt" vega1@uakron.edu < /export/home/vega/test.txt

  Note: there is no "$" in front of a real file name.
        use "$" when you are referening to the value of a
        var

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7055904
did you ask for ATTACHMENT (as decribed in the RFCs) ?
then it does not work as described. Dot.

Read my other comments, then try it.
0
 

Author Comment

by:UnixKid
ID: 7055955
Thank, it works great.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7056545
would you please tell me the UNIX flaviour and version, as well as the mailx version, where this command produces a mail with an attachment and not just a plain text mail.
Thanks.
0
 

Author Comment

by:UnixKid
ID: 7057776
Sun 8, I don't now the mail version.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question