<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem w/ -s switch on mailx in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079330#M735852</link>
    <description>Have you tried interactively running the mailx command line by itself instead of in a script? Would help troubleshooting the issue. Run the command and post the output here.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 02 Oct 2007 15:51:22 GMT</pubDate>
    <dc:creator>Sandman!</dc:creator>
    <dc:date>2007-10-02T15:51:22Z</dc:date>
    <item>
      <title>Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079325#M735847</link>
      <description>I'm having a problem where the subject line of a mailx message buried in a HP-UX script is not being passed on the the recipient.  I have a test case, which works perfectly, but the production case doesn't.  Does anyone have any guidance on where I should suspect the problem is?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Mon, 01 Oct 2007 15:19:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079325#M735847</guid>
      <dc:creator>Mark Frederickson</dc:creator>
      <dc:date>2007-10-01T15:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079326#M735848</link>
      <description>Could you post the mailx command that you are using for both the test and production cases.&lt;BR /&gt;&lt;BR /&gt;~thanks</description>
      <pubDate>Mon, 01 Oct 2007 15:22:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079326#M735848</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-10-01T15:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079327#M735849</link>
      <description>Here's the prod version that does not work:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;echo 'Script execution begins..........'&lt;BR /&gt;export ORACLE_SID=odsdw3&lt;BR /&gt;echo "&lt;BR /&gt;WHENEVER SQLERROR EXIT FAILURE;&lt;BR /&gt;set serveroutput off;&lt;BR /&gt;spool /tmp/mks2997.log;&lt;BR /&gt;@/hna/scripts/dba_scripts/catapult_tables_refresh.sql&lt;BR /&gt;spool OFF;&lt;BR /&gt;" | sqlplus @/u01/app/oracle/admin/odsdw3/util/parms.txt &lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;        echo "Script successfully executed!"&lt;BR /&gt;        mailx -s "GDW:DW3:catapult_tables_refresh.sql execution log" mark.frederickson@us.hjheinz.com &amp;lt; /tmp/mks2997.log&lt;BR /&gt;exit 0&lt;BR /&gt;else&lt;BR /&gt;        echo "Errors encountered. Check Log!"&lt;BR /&gt;        mailx -s "GDW:DW3:catapult_tables_refresh.sql execution log" mark.frederickson@us.hjheinz.com &amp;lt; /tmp/mks2997.log&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Here's the test case that does:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;echo 'Script execution begins..........'&lt;BR /&gt;export ORACLE_SID=odsdw3&lt;BR /&gt;echo "&lt;BR /&gt;WHENEVER SQLERROR EXIT FAILURE;&lt;BR /&gt;set serveroutput off;&lt;BR /&gt;spool /tmp/MailTest.log;&lt;BR /&gt;@/hna/scripts/dba_scripts/MailTest.sql&lt;BR /&gt;spool OFF;&lt;BR /&gt;" | sqlplus @/u01/app/oracle/admin/odsdw3/util/parms.txt &lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;        echo "Script successfully executed!"&lt;BR /&gt;        mailx -s "GDW:DW3:MailTest.sql execution log" mark.frederickson@us.hjheinz.com &amp;lt; /tmp/mks2997.log &lt;BR /&gt;exit 0&lt;BR /&gt;else&lt;BR /&gt;        echo "Errors encountered. Check Log!"&lt;BR /&gt;        mailx -s "GDW:DW3:MailTest.sql execution log" mark.frederickson@us.hjheinz.com &amp;lt; /tmp/MailTest.log&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Oct 2007 15:25:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079327#M735849</guid>
      <dc:creator>Mark Frederickson</dc:creator>
      <dc:date>2007-10-01T15:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079328#M735850</link>
      <description>I'm not sure what's different between the two.&lt;BR /&gt;You may need to add "set -x" to trace your problem.&lt;BR /&gt;&lt;BR /&gt;I naturally don't have problems because I change your "sqlplus" to /usr/bin/true or false and I echo something to /tmp/mks2997.log.&lt;BR /&gt;&lt;BR /&gt;Are you saying you don't get mail, or you have the wrong subject?&lt;BR /&gt;&lt;BR /&gt;In your "good" one, you seem to have this inconsistency:&lt;BR /&gt;spool /tmp/MailTest.log;&lt;BR /&gt;&lt;BR /&gt;Then you read from either /tmp/mks2997.log (success) or /tmp/MailTest.log (failure).</description>
      <pubDate>Mon, 01 Oct 2007 21:53:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079328#M735850</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-10-01T21:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079329#M735851</link>
      <description>Dennis,&lt;BR /&gt;&lt;BR /&gt;Thanks for taking the time to look @ this.  To answer your questions, I am getting mail, no problem.  The issue is that the subject line is not being passed in the prod example.  The difference in the file redirection, mks2997.log or MailTest.log makes no difference in the results.&lt;BR /&gt;&lt;BR /&gt;Mark</description>
      <pubDate>Tue, 02 Oct 2007 15:02:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079329#M735851</guid>
      <dc:creator>Mark Frederickson</dc:creator>
      <dc:date>2007-10-02T15:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079330#M735852</link>
      <description>Have you tried interactively running the mailx command line by itself instead of in a script? Would help troubleshooting the issue. Run the command and post the output here.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Oct 2007 15:51:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079330#M735852</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-10-02T15:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079331#M735853</link>
      <description>Yes I have &amp;amp; it works as I would expect.  It is only the prod version of the script that is causing me heartburn.&lt;BR /&gt;&lt;BR /&gt;Thanks for contributing to my hopeful resolution, however.</description>
      <pubDate>Tue, 02 Oct 2007 15:53:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079331#M735853</guid>
      <dc:creator>Mark Frederickson</dc:creator>
      <dc:date>2007-10-02T15:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079332#M735854</link>
      <description>&amp;gt;The issue is that the subject line is not being passed in the prod example.&lt;BR /&gt;&lt;BR /&gt;It worked for me.  Do you get a subject at all?  (It would help if your mail subject said whether it was good or bad results.  ;-)&lt;BR /&gt;&lt;BR /&gt;Can you add that "set -x" so we can trace your execution path?&lt;BR /&gt;I don't see how that -s option can fail.  You are quoting it.  You don't have any special chars in it.  A cut&amp;amp;paste of your example shows one long line.  (Are you doing this in crontab?)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;The difference in the file redirection, mks2997.log or MailTest.log makes no difference in the results.&lt;BR /&gt;&lt;BR /&gt;I had to change it so it existed.  Otherwise the mail wasn't sent.&lt;BR /&gt;&lt;BR /&gt;(You may want to ask the moderators to disguise/remove your mail address.  You may get spam from it.  Make your request here:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1157827" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1157827&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Sandman: Have you tried interactively running the mailx command line by itself instead of in a script?&lt;BR /&gt;&lt;BR /&gt;Hmm, when I diffed the two, the mailx line looked almost the same.&lt;BR /&gt;&lt;BR /&gt;One other thing is the fact that the subject has multiple ":" in it.  But both the good and the bad do.  Some mail clients may not like it?  What do you use to read it?</description>
      <pubDate>Tue, 02 Oct 2007 21:52:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079332#M735854</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-10-02T21:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079333#M735855</link>
      <description>Unfortunately /var/adm/syslog/mail.log doesn't seem to record the subject.</description>
      <pubDate>Tue, 02 Oct 2007 22:02:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079333#M735855</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-10-02T22:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079334#M735856</link>
      <description>&amp;gt;The issue is that the subject line is not being passed in the prod example.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;It worked for me. Do you get a subject at all? (It would help if your mail subject said whether it was good or bad results. ;-)&lt;BR /&gt;&lt;BR /&gt;No, I do not get a subject at all when the prod script is run &amp;amp; I know we should have some kind of indicator of success/failure, but I'm dealing with a third-party out-sourcing organization &amp;amp; they are a bunch of kunckleheads.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Can you add that "set -x" so we can trace your execution path?&lt;BR /&gt;&lt;BR /&gt;Here's the example with 'set -x' trace on (this test results in a good subject line returned to me):&lt;BR /&gt;&lt;BR /&gt;hgdwtest:mfrederi:/home/mfrederi$log" mark.frederickson@us.hjheinz.com &amp;lt; /tmp/MailTest.log                         &amp;lt;&lt;BR /&gt;+ mailx -s GDW:DW3:MailTest.sql execution log mark.frederickson@us.hjheinz.com&lt;BR /&gt;+ 0&amp;lt; /tmp/MailTest.log&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I don't see how that -s option can fail. You are quoting it. You don't have any special chars in it. &lt;BR /&gt;&lt;BR /&gt;I don't see how this could fail either, which is the reason why I thought I would ask you all!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Are you doing this in crontab?&lt;BR /&gt;&lt;BR /&gt;Yes, the prod script is scheduled with crontab.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;One other thing is the fact that the subject has multiple ":" in it. But both the good and the bad do. Some mail clients may not like it? What do you use to read it?&lt;BR /&gt;&lt;BR /&gt;In my test today, I executed from the command line with the ':' &amp;amp; '.' in place.  It still works (and always had @ the cmd-line - it's when run in the prod script that it is a problem).  &lt;BR /&gt;&lt;BR /&gt;I am sending this to a MS Outlook client.&lt;BR /&gt;&lt;BR /&gt;Thanks for looking into this!&lt;BR /&gt;&lt;BR /&gt;Mark</description>
      <pubDate>Wed, 03 Oct 2007 12:38:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079334#M735856</guid>
      <dc:creator>Mark Frederickson</dc:creator>
      <dc:date>2007-10-03T12:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079335#M735857</link>
      <description>To troubleshoot further you can look in the "/var/spool/mqueue" dir on prod and see if the mail to be sent out has a Subject line. This eliminates whether the problem is with the server sending out the email or somewhere downstream (mail relay host). Also do the prod and test servers use the same mail relays? After executing the mailx cmd look up its Q-ID and grep for the Subject line i.e.&lt;BR /&gt;&lt;BR /&gt;# cd /var/spool/mqueue&lt;BR /&gt;# mailx &lt;REST_OF_CMD...&gt;&lt;BR /&gt;---  now get the Q-ID of the email to be sent out&lt;BR /&gt;# mailq&lt;BR /&gt;# grep Subject qf&lt;Q-ID&gt;&lt;/Q-ID&gt;&lt;/REST_OF_CMD...&gt;</description>
      <pubDate>Wed, 03 Oct 2007 13:05:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079335#M735857</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-10-03T13:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem w/ -s switch on mailx</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079336#M735858</link>
      <description>&amp;gt;Here's the example with 'set -x' trace on (this test results in a good subject line returned to me):&lt;BR /&gt;&lt;BR /&gt;Are you saying when you add "set -x" it works?  Or you didn't instrument the bad one?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Sandman: To troubleshoot further you can look in the "/var/spool/mqueue" dir on prod and&lt;BR /&gt;&lt;BR /&gt;Won't you have to stop sendmail so it remains in the queue long enough to look at?</description>
      <pubDate>Wed, 03 Oct 2007 18:51:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-w-s-switch-on-mailx/m-p/4079336#M735858</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-10-03T18:51:03Z</dc:date>
    </item>
  </channel>
</rss>

