Expect script environment variable issue
<p>I would like to receive help to resolve my expect script issue.  </p>

<p>when I use the command "env" on my linux termial, I can see <code>$INFO_HME</code> as <code>/app/informatica/etldev/9.1/server</code>. </p>

<p>But i am not able to use <code>$INFO_HME</code> it in my expect script and getting error. My script shown below.</p>

<p>I presume, <code>$INFO_HME</code> will be replacled as <code>/app/informatica/etldev/9.1/server</code> in the <code>lcd</code> command.</p>

<pre><code>#!/usr/bin/expect
spawn /usr/bin/sftp &lt;ID_Here&gt;@&lt;Host_Here&gt; 
expect "password:" 
send "&lt;Password_Here&gt;\n" 
expect "sftp&gt;" 
send "lcd $INFO_HME/infa_shared/SrcFiles\n" 
expect "sftp&gt;" 
send "cd \"/Source/client\"\n" 
expect "sftp&gt;" 
send "get file.csv\n"; 
expect "sftp&gt;" 
send "quit\n" 
</code></pre>

<p>Error message:</p>

<pre><code>sftp&gt; can't read "INFO_HME": no such variable
    while executing
"send   "lcd $INFA_HOME/infa_shared/SrcFiles\n""
    (file "Scr_Webcore_SFTP.sh" line 7)   
</code></pre>

<p>Deeply appreciate any help to resolve this.</p>