From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17434 invoked from network); 25 Aug 1999 16:48:57 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Aug 1999 16:48:57 -0000 Received: (qmail 14404 invoked by alias); 25 Aug 1999 16:48:40 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2517 Received: (qmail 14397 invoked from network); 25 Aug 1999 16:48:39 -0000 Date: Wed, 25 Aug 1999 17:48:37 +0100 (BST) From: "Owen M. Astley" X-Sender: oma1000@alpha2.poco.phy.cam.ac.uk To: zsh-users@sunsite.auc.dk Subject: Re: Perl like select()? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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