#!../expect -f

# archie

# Log in to the archie ftp-catalog at McGill University, and mail back results
# Brian P. Fitzgerald
# Department of Mechanical Engineering
# Rensselaer Polytechnic Institute

set CINTR       \CC
set CSUSP       \CZ

spawn telnet quiche.cs.mcgill.ca
expect {
	*login:*	{send archie\r}
	*unknown*\r*	{exit 1}
	*unreachable*	{exit 1}
}

expect	*archie>*	{send set pager\r}
expect	*archie>*	{send set  maxhits 20\r}
expect	*archie>*	{send set term vt100\r}
expect	*archie>*	{send set sortby time\r}
expect	*archie>*	{send set mailto you@your.edu\r}

send_user "type ^C to exit, ^Z to suspend\n"
interact	$CINTR  {exit 0} $CSUSP  {exec kill -STOP 0}
