title: My remote server cannot recognize the variable using sftp in shell scripting
body: <h2>my script</h2>
  
  <pre><code>#!/bin/ksh 
  ysdt=`date -d '-1 day' '+%Y%m%d'` 
  expect &lt;&lt; 'EOS'
  spawn  sftp id@192.168.61.240:/data01/msc/huawei
  expect "Password:"
  send "password\n"
  expect "sftp&gt;"
  send "mkdir $ysdt\n" 
  expect "sftp&gt;"
  send "cd /data01/msc/huawei/$ysdt\n" 
  expect "sftp&gt;"
  send "put /home/med/cdr/bak/hw/mss/prm/$ysdt/b*"
  expect "sftp&gt;"
  send "bye\n"
  EOS
  </code></pre>
  
  <p>-----error show-----------</p>
  
  <pre><code>can't read "ysdt": no such variable
      while executing
  "send "mkdir $ysdt\n" "
  </code></pre>