zsh-workers
 help / color / mirror / code / Atom feed
* why is SHINSTDIN an option?
@ 1996-04-11  4:13 Richard J. Coleman
  1996-04-11  5:10 ` Zefram
  1996-04-11  5:17 ` Barton E. Schaefer
  0 siblings, 2 replies; 3+ messages in thread
From: Richard J. Coleman @ 1996-04-11  4:13 UTC (permalink / raw)
  To: zsh-workers

Is there any reason for SHINSTDIN to be an option?
In the code, it seems to primarily be used a global variable
keeping track of where the input stream is coming from.  Since
the code changes it so often, is there any time where a user
would want to set this himself?

rc



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: why is SHINSTDIN an option?
  1996-04-11  4:13 why is SHINSTDIN an option? Richard J. Coleman
@ 1996-04-11  5:10 ` Zefram
  1996-04-11  5:17 ` Barton E. Schaefer
  1 sibling, 0 replies; 3+ messages in thread
From: Zefram @ 1996-04-11  5:10 UTC (permalink / raw)
  To: Richard J. Coleman; +Cc: Z Shell workers mailing list

>Is there any reason for SHINSTDIN to be an option?
>In the code, it seems to primarily be used a global variable
>keeping track of where the input stream is coming from.  Since
>the code changes it so often, is there any time where a user
>would want to set this himself?

I was wondering that myself.  It doesn't actually seem to be very
meaningful.  Its only purpose seems to be to allow user code to test
it, but I don't see why one would want to do that -- INTERACTIVE is a
better test of interactiveness.

But the corresponding command line option, -s, must remain, so I
recommend that SHINSTDIN should stay.  I think, however, it should
become read-only, like INTERACTIVE.  It is already read-only in the
Bourne shell here.

-zefram



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: why is SHINSTDIN an option?
  1996-04-11  4:13 why is SHINSTDIN an option? Richard J. Coleman
  1996-04-11  5:10 ` Zefram
@ 1996-04-11  5:17 ` Barton E. Schaefer
  1 sibling, 0 replies; 3+ messages in thread
From: Barton E. Schaefer @ 1996-04-11  5:17 UTC (permalink / raw)
  To: Richard J. Coleman, zsh-workers

On Apr 11, 12:13am, Richard J. Coleman wrote:
} Subject: why is SHINSTDIN an option?
}
} Is there any reason for SHINSTDIN to be an option?
} is there any time where a user would want to set this himself?

I think it's an option mostly so it can be tested, rather than set.

    if [[ -o shinstdin ]]
    then
	echo "I was run with 'zsh < somefile', so \$0 is zsh"
    else
	echo "I was run with 'zsh $0' or '. $0' or just as '$0'"
    fi

I suppose there might be some reason to want to spoof the above by
setopt/unsetopt of shinstdin, but I can't think of one offhand.

Further, it could conceivably have other uses, particularly as a
command-line option.  Consider:

    #! /usr/local/bin/zsh -s
    echo This does not happen.

I'd be reluctant to eliminate the option, if that's what you are
thinking about.

-- 
Bart Schaefer                     Vice President, Technology, Z-Code Software
schaefer@z-code.com                  Division of NCD Software Corporation
http://www.well.com/www/barts



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1996-04-11  5:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-11  4:13 why is SHINSTDIN an option? Richard J. Coleman
1996-04-11  5:10 ` Zefram
1996-04-11  5:17 ` Barton E. Schaefer

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).