&reftitle.examples;
Expect Usage Examples Expect Usage Example This example connects to the remote host via SSH, and prints the remote uptime. "password:", 1 => PASSWORD) ); switch (expect_expectl ($stream, $cases)) { case PASSWORD: fwrite ($stream, "password\n"); break; default: die ("Error was occurred while connecting to the remote host!\n"); } while ($line = fgets($stream)) { print $line; } fclose ($stream); ?> ]]> The following example connects to the remote host, determines whether installed OS is for 32 or 64 bit, then runs update for specific package. Another Expect Usage Example ]]>