zsh-users
 help / color / mirror / code / Atom feed
From: "Owen M. Astley" <oma1000@cam.ac.uk>
To: zsh-users@sunsite.auc.dk
Subject: Re: Perl like select()?
Date: Wed, 25 Aug 1999 17:48:37 +0100 (BST)	[thread overview]
Message-ID: <Pine.OSF.3.96.990825174543.20161B-100000@alpha2.poco.phy.cam.ac.uk> (raw)
In-Reply-To: <E11JfiW-0001Ad-00@crucigera.fysh.org>

On Wed, 25 Aug 1999, Zefram wrote:

> Josh Howard wrote:
> >Is there any way, in a script, to use a "Perl-like" select() to
> >associate stdout with a particular file, before the execution of the
> >rest of the script?
> 
> 	exec > file
> 
> permanently redirects stdout.  Any redirection can be used this way.

This works in /bin/sh here, but not under zsh (I've tried
zsh-3.0.{0,5,6}), and I've always thought that it was a feature of zsh
that it didn't.

Example...

alpha2----~/tmp% { exec >foo
cursh> echo bar
cursh> }
zsh: command name expected
bar
alpha2----~/tmp% ls -l foo
-rw-r--r--   1 oma1000  colloids       0 Aug 25 17:46 foo

So I guess that there is something odd with my setup.  Does anybody
have any ideas?  Just to start you off, these are the options that I am
setting...

alpha2----~/tmp% grep setop ~/.zshrc
compctl -o setopt unsetopt isset
#unsetopt AUTO_LIST
unsetopt BEEP               # Don't beep ever.
setopt AUTO_LIST            # Auto list ambiguous choices.
#setopt AUTO_MENU            # Use menu completion for 2nd request.
unsetopt MENU_COMPLETE      # Don't use menu completion for 1st request.
setopt ALWAYS_LAST_PROMPT   # List completions after the prompt.
setopt AUTO_NAME_DIRS       # ~dirname instead of absolute names.
setopt EXTENDED_GLOB        # Extended filename globbing.
setopt NO_CLOBBER           # Don't clobber files with >, or create with >>.
setopt LIST_TYPES           # Completions get a trailing id symbol.
setopt INTERACTIVE_COMMENTS # Allow comments in interactive shells.
unsetopt NOTIFY             # Wait before reporting status of background jobs.
unsetopt BG_NICE            # Don't run background jobs at a lower priority.
setopt IGNORE_EOF           # Don't exit on EOF.
setopt MULTIOS              # Glob after redirection operator.
setopt AUTO_PUSHD
setopt PUSHD_IGNORE_DUPS
setopt PUSHD_SILENT PUSHD_TO_HOME PUSHD_MINUS
setopt HIST_IGNORE_DUPS APPEND_HISTORY

Owen



  reply	other threads:[~1999-08-25 16:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-25 15:48 Josh Howard
1999-08-25 16:16 ` Zefram
1999-08-25 16:48   ` Owen M. Astley [this message]
1999-08-25 17:00     ` Bart Schaefer
1999-08-25 17:08       ` Owen M. Astley
1999-08-25 16:49   ` Bart Schaefer
1999-08-25 18:35   ` Josh Howard
1999-08-27 10:56   ` Nemeth Ervin
1999-08-25 16:26 Jay Sekora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.OSF.3.96.990825174543.20161B-100000@alpha2.poco.phy.cam.ac.uk \
    --to=oma1000@cam.ac.uk \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).