Hi Tarikc,
I have never written anything in expect before now but this works just fine.
Code:
#!/usr/bin/expect
puts "This is arg0 [lindex $argv 0]"
puts "This is arg1 [lindex $argv 1]"
Which when run
Code:
./your_expect_script foo bar
The output would be:
This is arg0 foo
This is arg1 bar
So for the bash part you would simply be
Code:
for i in {1..255};
do
/path to your expect script/your_expect_script $i
done
If we used the example expect script from above you get the following.
Code:
$ for i in {1..255}; do ./test.expect $i; done
This is arg0 1
This is arg1
This is arg0 2
This is arg1
This is arg0 3
..
..
This is arg1
This is arg0 255
This is arg1
That should get you going.
If not have a look for arguments, parameters and variables, most languages will have these and there are bound to be plenty of examples around.