Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

commands sometimes don't execute



To see where the zsh bug is, search below for the string "never execute"

The script that exhibits the alleged zsh bug is
a handy little script you might find useful if
you are connected to the internet only on demand.
You run this command when you want to force a connection.

VERSION=zsh 2.5.03

Thanks.

Dave

 = = = = = = = = =
#!/bin/zsh
# or maybe late model ksh

# Force a connection to the Internet
# Dave@xxxxxxxx 95-1-28 Works on SGI
# Dave@xxxxxxxx 95-6-25 when this initiates a connection, print date (doesn't work)

provider=Internex
ppphost=internexppp
# InterNex trouble phone number 800 291 5178
# PacBell priority repair number 811 8081
# ISDN Hotline 800 472 4736

verbose=yes
repeating=
already_connected=yes

case "$1" in
-q) verbose= ;;
-r) repeating=yes ;;
"") ;;
*) echo 1>&2 "
Usage: internet [ -q ]

The -q option suppresses the usual verbose output.
" ;;
esac

jab () {
    ping -qc 1 $ppphost | grep '1 packets received' > /dev/null
    echo $?
}

case "$verbose" in
yes) (sleep  2 ;
      echo 1>&2 "Trying to call ${provider}...\c" ;
      sleep 30 ;
      echo 1>&2 ;
      echo 1>&2 "Trouble number is 800 291 5178" ;
      )&
esac

if [[`jab` != 0]] ; then
    until [[`jab` = 0]] ; do
	case "$verbose" in
	yes)
	    echo 1>&2 ".\c"
	esac
    done

    # The commands from here to fi almost never execute
    # even when execution has clearly traversed the until loop.
    case "$verbose" in
	yes) echo 1>&2 ""
	esac

    echo "If you can see this, it works (but you can't)."
    already_connected=no
fi

case "$verbose" in
yes) kill %%
     case $already_connected in
     yes) when=       ;;
     *)   when=`date` ;;
     esac
     echo 1>&2 Connected $when
esac



Messages sorted by: Reverse Date, Date, Thread, Author