Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: checking if in interactive shell



Laurent Wacrenier <Laurent.Wacrenier@xxxxxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author