Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: null commands...
- X-seq: zsh-users 468
- From: Geoff Wing <gwing@xxxxxxxxxxxxxxx>
- To: hniksic@xxxxxxx (Hrvoje Niksic)
- Subject: Re: null commands...
- Date: Mon, 28 Oct 1996 22:53:55 +1100 (EST)
- Cc: zefram@xxxxxxxxxxxxxxxxx, gwing@xxxxxxxxxxxxxxx, tsv@xxxxxxxxxxxxxxx, zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: <kigohhp69qx.fsf@xxxxxxxxxxxxx> from "Hrvoje Niksic" at Oct 26, 96 04:11:34 pm
Hrvoje Niksic wrote:
:Zefram (zefram@xxxxxxxxxxxxxxxxx) 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@xxxxxxxxxxxxxxx] PrimeNet - Internet Consultancy
Web : http://www.primenet.com.au/ Phone : +61-3-9818 2977
Mobile: 0412 162 441 Facsimile: +61-3-9819 3788
Messages sorted by:
Reverse Date,
Date,
Thread,
Author