title: How to count command line arguments in expect script?
body: <p>This is my simple expect script:</p>
  
  <pre><code>#!/usr/local/bin/expect
  puts "Argu 1 : [lindex $argv 0]"
  
  Run
  ---
  expect example.expt Testing
  
  Output
  ------
  Argu 1: Tesing
  </code></pre>
  
  <p>I need to count the arguments, which are passed by command line. Like this:</p>
  
  <pre><code>expect example.expt 1 2 3 4
  
  I need the script for the following output
  Total: 4 arguments
  Arg1: 1
  Arg2: 2
  Arg3: 3
  Arg4: 4
  </code></pre>
  
  <p>How can I do this? Thanks!</p>