From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id XAA02021 for ; Mon, 28 Oct 1996 23:30:20 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id HAA02690; Mon, 28 Oct 1996 07:17:51 -0500 (EST) Resent-Date: Mon, 28 Oct 1996 07:03:46 -0500 (EST) From: Geoff Wing Message-Id: <199610281153.WAA01883@coral.primenet.com.au> Subject: Re: null commands... To: hniksic@srce.hr (Hrvoje Niksic) Date: Mon, 28 Oct 1996 22:53:55 +1100 (EST) Cc: zefram@dcs.warwick.ac.uk, gwing@primenet.com.au, tsv@cs.umanitoba.ca, zsh-users@math.gatech.edu In-Reply-To: from "Hrvoje Niksic" at Oct 26, 96 04:11:34 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"ns1mj2.0.sd.Y4ATo"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/468 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hrvoje Niksic wrote: :Zefram (zefram@dcs.warwick.ac.uk) wrote: :> >But it would be a good idea to set READNULLCMD to value of $PAGER by :> >default, wouldn't it? :> Do you set $PAGER before invoking zsh? I don't. : :Sorry, this one is obviously wrong. READNULLCMD should be unset (or :empty) by default. Then, if READNULLCMD is empty, zsh should use :${PAGER:-more} for < file shorthands. If not, it should use whatever :is found in READNULLCMD. How does that sound? The current behaviour for READNULLCMD is: it is originally set to `more'. If it is unset, then the value in NULLCMD is used, which is normally `cat' (unless you are trying to emulate sh/ksh/csh). I don't agree that READNULLCMD should default to any value in PAGER if one exists. However, what might be nicer is: if READNULLCMD use READNULLCMD else if PAGER /____ this is only change to use PAGER \ the current system. else if NULLCMD use NULLCMD else echo "zsh: redirection with no command" It might be nice to have READNULLCMD parse or pass arguments, but I, myself, probably won't use it. In another message, Zefram wrote: :No. Arguments in $PAGER might or might not work, depending on the :program interpreting it. (I am of the opinion that they should not :work.) A lot of programs out there use the system() command on this, which on most machines does "sh" "-c" "arguments". So people strcat() the filename/s onto the end of the PAGER var and just system() it. (Of course, a lot of other people think you should never use the system() call, but let's NOT get into that debate). Of course, given that this is internal to the shell, it would be ludicrous for us to use system(). I'm just stating how other people use it. -- Geoff Wing [gwing@primenet.com.au] PrimeNet - Internet Consultancy Web : http://www.primenet.com.au/ Phone : +61-3-9818 2977 Mobile: 0412 162 441 Facsimile: +61-3-9819 3788