- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Empty subject when using mailx.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2005 10:16 AM
тАО10-02-2005 10:16 AM
I getting an empty email when using the following command in a Korn shell script:
subject="Testing ..."
echo "Subject =${subject}"
mailx -s"${subject}" myemail
Anyone can help on this?
Adnane
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2005 10:52 AM
тАО10-02-2005 10:52 AM
Re: Empty subject when using mailx.
By redirecting /dev/null to STDIN you got exactly what you asked: an empty email body.
You could redirect another file, instead, or you could type your email body message at the command line and type CNTL_D (end-of-text) to signal its end. For example:
mailx -s "Testing..." myuser
This is line-1
and this is line-2
of a three-line message
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2005 06:24 PM
тАО10-02-2005 06:24 PM
Re: Empty subject when using mailx.
subject="Testing..."
echo "Subject= ${subject}"
mailx -s "$subject" root@localhost mail
You will get that recent mail with Testing... as subject.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2005 12:38 AM
тАО10-03-2005 12:38 AM
Re: Empty subject when using mailx.
I getting an empty subject. The /dev/null is intentional to get an empty email but why the subject is empty?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2005 12:50 AM
тАО10-03-2005 12:50 AM
Re: Empty subject when using mailx.
# subject="check..."
# echo "Subject: ${subject}" | sendmail root@localhost
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2005 01:05 AM
тАО10-03-2005 01:05 AM
Re: Empty subject when using mailx.
mailx -s "$subject" myemail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2005 02:58 AM
тАО10-03-2005 02:58 AM
Re: Empty subject when using mailx.
I also get the feeling that Pat is right and the {} need to go too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2005 03:20 AM
тАО10-03-2005 03:20 AM
Re: Empty subject when using mailx.
I think the second line is not necessary, simply use
#!/bin/ksh
subject="Testing ..."
mailx -s ${subject} who@myemail.com < /dev/null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2005 12:13 AM
тАО10-04-2005 12:13 AM
Re: Empty subject when using mailx.
I tried your suggestions and I├в m getting the same problem (the sendmail as mention by HTH did not work for me, I think the setup for the DS entry is messing in the sendmail.cf file).
However I found out that when I submit the job my self I got the the email and the subject but when the scripts is submitted by the scheduler MAESTRO (scheduler program from IBM that runs under UNIX HP) I got the email but not the subject.
Did anyone have an idea ?
Thanks to all for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2005 12:50 AM
тАО10-04-2005 12:50 AM
Re: Empty subject when using mailx.
As mentioned in Matthew's post, do you have the #!/bin/ksh line at the top of your script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2005 03:50 AM
тАО10-04-2005 03:50 AM
Re: Empty subject when using mailx.
Yes Pat I do have #!/bin/ksh.
Just to mention that my script is working perfectly in the DEV server, the problem occur on another UNIX HP server.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2005 03:56 AM
тАО10-04-2005 03:56 AM
Re: Empty subject when using mailx.
Sorry I wasn't more help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2005 06:17 AM
тАО10-04-2005 06:17 AM
Re: Empty subject when using mailx.
#subject=Testing...
#echo $subject
..it echo'd properly..
#mailx -s $subject rworkman@mydomain.com < /dev/null
and then I
#mail -s $subject rworkman@mydomain.com
.
...and they both went to my email reflecting a subject of ... Testing...
Yeppers...drop the {}
Rgrds,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2005 09:56 AM
тАО10-05-2005 09:56 AM
SolutionThough I feel your question on the blank subject has been answered, I am attaching a list of different uses of mailx that are used in out shop. Should you still be having a problem, try an example from that attached.
Best of luck.
Regards,
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-06-2005 01:05 AM
тАО10-06-2005 01:05 AM
Re: Empty subject when using mailx.
I removed the /dev/null because it seems causing the problem in the subject.
Now I'm using the mailx command :
echo "$EMAIL_SUBJ" | mailx -s"$EMAIL_SUBJ" "$recipient"
Adnane.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-06-2005 01:06 AM
тАО10-06-2005 01:06 AM
Re: Empty subject when using mailx.
and using the mailx command as:
echo "$EMAIL_SUBJ" | mailx -s"$EMAIL_SUBJ" "$recipient"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-06-2005 01:08 AM
тАО10-06-2005 01:08 AM
Re: Empty subject when using mailx.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-06-2005 01:09 AM
тАО10-06-2005 01:09 AM
Re: Empty subject when using mailx.
I hope you are a new number. Try to assin points to those spent time with you. Hope you know the way to give points.
thx.