zsh-users
 help / color / mirror / code / Atom feed
* checking if in interactive shell
@ 1995-09-10  2:21 Timothy J. Luoma
  0 siblings, 0 replies; 3+ messages in thread
From: Timothy J. Luoma @ 1995-09-10  2:21 UTC (permalink / raw)
  To: zsh-users


Ok, in csh I'd check for interactive shell via this:

if( ${?prompt} ) then
	(do stuff)
endif

how do I do this in zsh?

Thanks!
TjL
---
Timothy J. Luoma 	              luomat@capitalist.princeton.edu
NeXT 3.2 m68k		               Another convert to the Z-Shell
MIME & NeXTMail OK but remember I'm using PPP, so big email = trouble
"If I  understood the man page, I wouldn't have asked the question."


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

* Re:  checking if in interactive shell
  1995-09-10  2:34 Laurent Wacrenier
@ 1995-09-10  5:45 ` Chris P. Ross
  0 siblings, 0 replies; 3+ messages in thread
From: Chris P. Ross @ 1995-09-10  5:45 UTC (permalink / raw)
  To: Laurent Wacrenier; +Cc: luomat, zsh-users


Laurent Wacrenier <Laurent.Wacrenier@gin.obspm.fr> said:
>> Ok, in csh I'd check for interactive shell via this:
> [ csh code deleted :]

>> how do I do this in zsh?

> I would do it like this :

> case "$-" in
> *i*) interactive ;;
> *) not interactive ;;
> esac

  Doh!  What's wrong with:

  if [[ -o interactive ]]; then
    # We're interactive!
  fi


> -- Laurent

           - Chris


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

* Re:  checking if in interactive shell
@ 1995-09-10  2:34 Laurent Wacrenier
  1995-09-10  5:45 ` Chris P. Ross
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Wacrenier @ 1995-09-10  2:34 UTC (permalink / raw)
  To: luomat, zsh-users

> Ok, in csh I'd check for interactive shell via this:

[ csh code deleted :]

> how do I do this in zsh?

I would do it like this :

case "$-" in
*i*) interactive ;;
*) not interactive ;;
esac

-- Laurent


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

end of thread, other threads:[~1995-09-10  5:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-09-10  2:21 checking if in interactive shell Timothy J. Luoma
1995-09-10  2:34 Laurent Wacrenier
1995-09-10  5:45 ` Chris P. Ross

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