From owner-freebsd-questions Wed Apr 29 13:57:19 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA26780 for freebsd-questions-outgoing; Wed, 29 Apr 1998 13:57:19 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from gdi.uoregon.edu (gdi.uoregon.edu [128.223.170.30]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA26717 for ; Wed, 29 Apr 1998 13:57:05 -0700 (PDT) (envelope-from dwhite@gdi.uoregon.edu) Received: from localhost (dwhite@localhost) by gdi.uoregon.edu (8.8.7/8.8.8) with SMTP id NAA13282; Wed, 29 Apr 1998 13:56:58 -0700 (PDT) (envelope-from dwhite@gdi.uoregon.edu) Date: Wed, 29 Apr 1998 13:56:58 -0700 (PDT) From: Doug White Reply-To: Doug White To: laszlo vagner cc: questions@FreeBSD.ORG Subject: Re: fetch and kill In-Reply-To: <199804240855.DAA03105@mutsgo.dyn.ml.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 24 Apr 1998, laszlo vagner wrote: > can someone please send me a script to do this as i am not > too good at knowing script language yet. > > i want to fetch a webpage and if it doesn't return the page, i want > to hang up the modem and redial or kill and restart ppp (same result). > > someone suggested something like > > fetch http://www.freebsd.org/index.html || kill ppp > > or something to this effect, i dont know what || means? || is the OR short-circuit operator. The shell executes the command in front of the ||; if it fails (ie returns an error code != 0) then it executes the right hand side. Otherwise it skips it. Doug White | University of Oregon Internet: dwhite@resnet.uoregon.edu | Residence Networking Assistant http://gladstone.uoregon.edu/~dwhite | Computer Science Major To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message