title: how to copy two files by SCP in expect script
body: <p>please advice why </p>
  
  <pre><code>     spawn  scp  $FILE1   $FILE2  $LOGIN@$IP:/tmp
  </code></pre>
  
  <p>in my expect script copy only FILE1 and not copy FILE2 ?</p>
  
  <p>I try to to transfer both files by scp  as</p>
  
  <pre><code> scp file1.csv file2.crt 192.8.200.1:/tmp 
  </code></pre>
  
  <p>without expect  and they transferred successfully to /tmp</p>
  
  <p>so why VIA expect the only file that copied is <strong>FILE1</strong> ?? </p>
  
  <p>what wrong in my syntax ?</p>
  
  <hr>
  
  <p>example of my expect script</p>
  
  <pre><code>#!/usr/bin/expect -f
  
  set FILE1  file1.csv
  set FILE2  file2.crt
  
  set multiPrompt {[#&gt;$]}
  
  spawn  scp  $FILE1   $FILE2  $LOGIN@$IP:/tmp
  expect {
      ")?"   { send "yes\r"  ; exp_continue  }
  
      word:  {send $PASS\r}
  }
  </code></pre>
  
  <p>I also try this:</p>
  
  <pre><code> spawn  scp  "$FILE1   $FILE2"   $LOGIN@$IP:/tmp
  </code></pre>
  
  <p>OR</p>
  
  <pre><code> spawn  scp  '$FILE1   $FILE2'   $LOGIN@$IP:/tmp
  </code></pre>
  
  <p>but I get the same problem</p>
  
  <p>PLEASE HELP!!!!!!!!</p>