[0;32m
expect-lite directive: *LOG [0m
spawn ssh -o StrictHostKeyChecking=no -l cvmiller localhost
Linux halaconia 2.6.32-5-powerpc #1 Mon Oct 3 04:26:33 UTC 2011 ppc

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have mail.
Last login: Sun Feb 10 19:52:07 2013 from localhost



cvmiller@halaconia:~$ 
cvmiller@halaconia:~$ 
cvmiller@halaconia:~$ [1;34m
 ==== Set Timeout ====
[0m
[0;32m

Setting Expect Timeout to: 4 

[0m
[0;32m
expect-lite directive: *EXP_INFO [0m
[1;34m
 === basic if code block
[0m
[0;32m
If: expr { "1" == "1" } |then[|result=TRUE
[0m
export PS1='$ '
$ 
$ echo "if1 good"
if1 good
$ [0;32m<
if1 good[0m
[1;34m
 === if else code block
[0m
[0;32m
If: expr { "1" != "1" } |then>echo "BAD"|else [|result=FALSE
[0m

$ echo "if2 good"
if2 good
$ [0;32m<
if2 good[0m
[1;34m
 === third if too many code blocks - should have warning
[0m
[0;32m
If: expr { "1" != "1" } |then [|else [|result=FALSE
[0m
[0;33m
Warning: Expect-lite: Code Blocks not supported in both then & else actions
[0m

$ [1;34m
 === nested ifs
[0m
[0;32m
If: expr { "1" == "1" } |then ?if 2==2? [ |result=TRUE
[0m
[0;32m
If: expr { "2" == "2" } |then [|result=TRUE
[0m

$ echo "good"
good
$ [0;32m<good[0m
[1;34m
 === nested ifs using code blocks
[0m
[0;32m
If: expr { "1" < "3" } |then   [|else >echo "else 1"|result=TRUE
[0m
[0;32m
If: expr { "2" < "3" } |then   [|else >echo "else 2"|result=TRUE
[0m

$ echo "good"
good
$ [0;32m<good[0m
[1;34m
 === if then else - taking else path
[0m
[0;32m
If: expr { "1" == "4" } |then   [|result=FALSE
[0m

$ echo "good"
good
$ [0;32m<good[0m
[1;34m
 === if then else - taking then path
[0m
[0;32m
If: expr { "1" != "5" } |then   [|result=TRUE
[0m
echo "good"
good
$ [0;32m<good[0m
[1;34m
 === Tested nested if then else - taking then path
[0m
[0;32m
If: expr { "5" == "5" } |then   [|result=TRUE
[0m
[0;32m
If: expr { "1" == "2" } |then [|result=FALSE
[0m
echo "good nested then, else"
good nested then, else
$ echo "good"
good
$ [0;32m<good[0m
[1;34m
 === Tested nested if then else - taking then else
[0m
[0;32m
If: expr { "1" == "5" } |then   [|result=FALSE
[0m
[0;32m
If: expr { "1" == "2" } |then [|result=FALSE
[0m
echo "good nested then, else"
good nested then, else
$ [0;32m<good[0m
[0;32m
expect-lite directive: *INTERACT [0m
[0;32m

 Press '+++' to end interact session & return to script 

[0m

$ [0;32m

INFO: FORK session is: default,	Active sessions are: default
[0m
[1;34m
 === while loops with code blocks
[0m
[1;34m
 === simple while loop
[0m
[0;32m
While: expr { "0" < "5" } |result=TRUE
[0m

$ 
$ echo "hello ken2"
hello ken2
$ [0;32m<ken[0m
[0;32m
While: expr { "1" < "5" } |result=TRUE
[0m
echo "hello ken2"
hello ken2
$ [0;32m<ken[0m
[0;32m
While: expr { "2" < "5" } |result=TRUE
[0m
echo "hello ken2"
hello ken2
$ [0;32m<ken[0m
[0;32m
While: expr { "3" < "5" } |result=TRUE
[0m
echo "hello ken2"
hello ken2
$ [0;32m<ken[0m
[0;32m
While: expr { "4" < "5" } |result=TRUE
[0m
echo "hello ken2"
hello ken2
$ [0;32m<ken[0m
[0;32m
While: expr { "5" < "5" } |result=FALSE
[0m
[0;32m
If: expr { "5" == "5" } |then   >echo "good"|result=TRUE
[0m
echo "good"
good
$ [0;32m<good[0m
[1;34m
 === while loop with break
[0m
[0;32m
While: expr { "0" < "5" } |result=TRUE
[0m

$ echo "hello ken2"
hello ken2
$ [0;32m<ken[0m
[0;32m
If: expr { "0" == "3" } |then   $i=5|result=FALSE
[0m
[0;32m
While: expr { "1" < "5" } |result=TRUE
[0m
echo "hello ken2"
hello ken2
$ [0;32m<ken[0m
[0;32m
If: expr { "1" == "3" } |then   $i=5|result=FALSE
[0m
[0;32m
While: expr { "2" < "5" } |result=TRUE
[0m
echo "hello ken2"
hello ken2
$ [0;32m<ken[0m
[0;32m
If: expr { "2" == "3" } |then   $i=5|result=FALSE
[0m
[0;32m
While: expr { "3" < "5" } |result=TRUE
[0m
echo "hello ken2"
hello ken2
$ [0;32m<ken[0m
[0;32m
If: expr { "3" == "3" } |then   $i=5|result=TRUE
[0m
[0;32m
While: expr { "6" < "5" } |result=FALSE
[0m
[0;32m
If: expr { "6" == "6" } |then   >echo "good"|result=TRUE
[0m
echo "good"
good
$ [0;32m<good[0m
[1;34m
 === Nested While loops
[0m

$ [1;34m
 == should repeat "hello ken" 3 times, with 2 "bye now"s inside each outer loop
[0m
[0;32m
While: expr { "0" < "3" } |result=TRUE
[0m

$ echo "hello ken"
hello ken
$ [0;32m<ken[0m
[0;32m
While: expr { "0" < "2" } |result=TRUE
[0m
echo "bye now"
bye now
$ [0;32m
While: expr { "1" < "2" } |result=TRUE
[0m

$ echo "bye now"
bye now
$ [0;32m
While: expr { "2" < "2" } |result=FALSE
[0m
[0;32m
While: expr { "1" < "3" } |result=TRUE
[0m

$ echo "hello ken"
hello ken
$ [0;32m<ken[0m
[0;32m
While: expr { "0" < "2" } |result=TRUE
[0m
echo "bye now"
bye now
$ [0;32m
While: expr { "1" < "2" } |result=TRUE
[0m

$ echo "bye now"
bye now
$ [0;32m
While: expr { "2" < "2" } |result=FALSE
[0m
[0;32m
While: expr { "2" < "3" } |result=TRUE
[0m

$ echo "hello ken"
hello ken
$ [0;32m<ken[0m
[0;32m
While: expr { "0" < "2" } |result=TRUE
[0m
echo "bye now"
bye now
$ [0;32m
While: expr { "1" < "2" } |result=TRUE
[0m

$ echo "bye now"
bye now
$ [0;32m
While: expr { "2" < "2" } |result=FALSE
[0m
[0;32m
While: expr { "3" < "3" } |result=FALSE
[0m
[0;32m
If: expr { "3" == "3" } |then   >echo "good"|result=TRUE
[0m

$ echo "good"
good
$ [0;32m<good[0m
[0;32m
If: expr { "2" == "2" } |then   >echo "good"|result=TRUE
[0m

$ echo "good"
good
$ [0;32m<good[0m
[1;34m
 === Negative testing of code blocks
[0m
[0;32m
expect-lite directive: *INTERACT [0m
[0;32m

 Press '+++' to end interact session & return to script 

[0m

$ 
$ [0;32mPrinting next 20 line(s) of script:[0m
[0;32m126 | 1 | {; == while statement with an "else" statement (should execute else statement)} {-1} [0m
[0;32m127 | 1 | {; === simple while loop} {-1} [0m
[0;32m128 | 1 | {$i=0} {-1} [0m
[0;32m129 | 1 | {[$i < 2} {133} [0m
[0;32m130 | 1 | {>echo "looping $i"} {-1} [0m
[0;32m131 | 1 | {<looping $i} {-1} [0m
[0;32m132 | 1 | {+$i} {-1} [0m
[0;32m133 | 1 | {]::[} {135} [0m
[0;32m134 | 1 | {>echo "good"} {-1} [0m
[0;32m135 | 1 | {]} {136} [0m
[0;32m136 | 1 | {<good} {-1} [0m
[0;32m137 | 1 | {>} {-1} [0m
[0;32m138 | 1 | {*TERM} {-1} [0m
[0;32m139 | 1 | {*INFINITE_LOOP 15} {-1} [0m
[0;32m140 | 1 | {; == test blank arg2} {-1} [0m
[0;32m141 | 1 | {>} {-1} [0m
[0;32m142 | 1 | {$blank=} {-1} [0m
[0;32m143 | 1 | {[3 == $blank} {145} [0m
[0;32m144 | 1 | {>echo "blank"} {-1} [0m
[0;32m145 | 1 | {]} {143} [0m

$ 
$ [0;32m

INFO: FORK session is: default,	Active sessions are: default
[0m
[1;34m
 == while statement with an "else" statement (should execute else statement)
[0m
[1;34m
 === simple while loop
[0m
[0;32m
While: expr { "0" < "2" } |result=TRUE
[0m

$ 
$ echo "looping 0"
looping 0
$ [0;32m<looping 0[0m
