I am trying to spawn scp command to copy one file from one server to another server. So, I am passing 8 arguments to an expect script as followsexpect my_x_script.exp file_src file_dest s_user s_pass s_host d_user d_pass d_hostIs it valid to pass these many arguments to an expect script?
Expect Script: Maximum number of command line arguments
arguments;expect
Yes there's no problem with that many arguments. Depending on your expect version, you extract the values with one of these:lassign $::argv \    src_file  src_user  src_pass  src_host \    dest_file dest_user dest_pass dest_host# orforeach {src_file src_user src_pass src_host dest_file dest_user dest_pass dest_host} $::argv {break}At some point, the user interface gets hard to manage though. You might want to look into using command line options to help keep things straight. Check out the cmdline package from tcllib. Then you can do:expect my_x_script.exp \    -src_file file_src \    -src_user s_user \    -src_pass s_pass \    -src_host s_host \    -dest_file file_dest \    -dest_user d_user \    -dest_pass d_pass \    -dest_host d_host