zsh-workers
 help / color / mirror / code / Atom feed
From: Dave@Yost.com
To: zsh-list@sterling.com
Cc: Dave@Yost.com
Subject: commands sometimes don't execute
Date: Thu, 06 Jul 1995 11:28:05 -0700	[thread overview]
Message-ID: <9507061828.AA00863@Yost.com> (raw)

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@Yost.com 95-1-28 Works on SGI
# Dave@Yost.com 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


             reply	other threads:[~1995-07-06 18:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-07-06 18:28 Dave [this message]
1995-07-18  9:20 Dave

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9507061828.AA00863@Yost.com \
    --to=dave@yost.com \
    --cc=zsh-list@sterling.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).