<?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: Scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671956#M51124</link>
    <description>To do double variable substition, you will need to use the "eval" statement-&lt;BR /&gt;&lt;BR /&gt;example-&lt;BR /&gt;&lt;BR /&gt;cust="cust1"&lt;BR /&gt;edi_cust1="user@mail.com"&lt;BR /&gt;eval temp=`echo \\${edi_$cust}`&lt;BR /&gt;&lt;BR /&gt;Would set temp to user@mail.com.&lt;BR /&gt;&lt;BR /&gt;Note the two \\ ... These are very important!&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills&lt;BR /&gt;</description>
    <pubDate>Tue, 26 Feb 2002 21:36:55 GMT</pubDate>
    <dc:creator>Rodney Hills</dc:creator>
    <dc:date>2002-02-26T21:36:55Z</dc:date>
    <item>
      <title>Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671952#M51120</link>
      <description>I have a script looking at some env variables and sending emails. I have imported some of the variables here to give an idea as below:&lt;BR /&gt;================================================&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;cust="cust1 cust2 cust3"&lt;BR /&gt;edi_cust1="mailaddress1.com"&lt;BR /&gt;edi_cust2="mailaddress2.com"&lt;BR /&gt;edi_cust3="mailaddress3.com"&lt;BR /&gt;&lt;BR /&gt;for i in $cust&lt;BR /&gt;do&lt;BR /&gt;temp="echo edi_cust_$i"&lt;BR /&gt;echo $temp&lt;BR /&gt;#echo "" | mailx -s "" $temp   --- ??????&lt;BR /&gt;done&lt;BR /&gt;=============================================&lt;BR /&gt;&lt;BR /&gt;What I need to accomplish is basically send an email to all customers listed. "$temp only returns edi_cust1,edi_cust2,edi_cust3.&lt;BR /&gt;What I need is the value to the right side of it i.e the email addresses.. &lt;BR /&gt;How do I accomplish this after getting $temp&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Krishnan&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Feb 2002 20:43:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671952#M51120</guid>
      <dc:creator>Krishnan Viswanathan</dc:creator>
      <dc:date>2002-02-26T20:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671953#M51121</link>
      <description>ditch the scripting of the e-mail addresses and setup an alias. Man aliases for information on how; basically edit /etc/mail/aliases as root and create a new entry with all of the addresses to which you want to send the mail. Be sure to use tabs to delimit the fields, then run "newaliases" when you are done to update sendmail with the new info.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;mark</description>
      <pubDate>Tue, 26 Feb 2002 21:03:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671953#M51121</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2002-02-26T21:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671954#M51122</link>
      <description>To get temp to be what you want use, single back quotes (`) instead of double quotes (").&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 26 Feb 2002 21:22:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671954#M51122</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-02-26T21:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671955#M51123</link>
      <description>This will accomplish what you want with the script:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;cust="cust1 cust2 cust3"&lt;BR /&gt;edi_cust1="mailaddress1.com"&lt;BR /&gt;edi_cust2="mailaddress2.com"&lt;BR /&gt;edi_cust3="mailaddress3.com"&lt;BR /&gt;&lt;BR /&gt;for i in $cust&lt;BR /&gt;do&lt;BR /&gt;eval temp=$"edi_$i"&lt;BR /&gt;echo $temp&lt;BR /&gt;#echo "" | mailx -s "" $temp --- ??????&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Then just change the mail line to something like:&lt;BR /&gt;&lt;BR /&gt;echo "This is a message" | mailx -s "Subject line" $temp</description>
      <pubDate>Tue, 26 Feb 2002 21:36:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671955#M51123</guid>
      <dc:creator>Eric Ladner</dc:creator>
      <dc:date>2002-02-26T21:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671956#M51124</link>
      <description>To do double variable substition, you will need to use the "eval" statement-&lt;BR /&gt;&lt;BR /&gt;example-&lt;BR /&gt;&lt;BR /&gt;cust="cust1"&lt;BR /&gt;edi_cust1="user@mail.com"&lt;BR /&gt;eval temp=`echo \\${edi_$cust}`&lt;BR /&gt;&lt;BR /&gt;Would set temp to user@mail.com.&lt;BR /&gt;&lt;BR /&gt;Note the two \\ ... These are very important!&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Feb 2002 21:36:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671956#M51124</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-02-26T21:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671957#M51125</link>
      <description>Rod,&lt;BR /&gt;&lt;BR /&gt;Even with single quotes I just get the variable only, not the value to the right side.&lt;BR /&gt;&lt;BR /&gt;Present Output : edi_cust1&lt;BR /&gt;         edi_cust2&lt;BR /&gt;         edi_cust3&lt;BR /&gt;&lt;BR /&gt;What I need is : mailaddress1.com&lt;BR /&gt;                 mailaddress2.com&lt;BR /&gt;                 mailaddress3.com&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Krishnan&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Feb 2002 21:37:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671957#M51125</guid>
      <dc:creator>Krishnan Viswanathan</dc:creator>
      <dc:date>2002-02-26T21:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671958#M51126</link>
      <description>Thank you guys -  A++.&lt;BR /&gt;&lt;BR /&gt;The "eval" expression worked !!&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Feb 2002 21:45:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/2671958#M51126</guid>
      <dc:creator>Krishnan Viswanathan</dc:creator>
      <dc:date>2002-02-26T21:45:56Z</dc:date>
    </item>
  </channel>
</rss>

