From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.mira.net.au (8.6.12/8.6.9) with SMTP id FAA27964 for ; Thu, 7 Sep 1995 05:00:05 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA03903 (5.65c/Gatech-10.0-IDA for ); Wed, 6 Sep 1995 15:02:40 -0400 Received: by math (5.x/SMI-SVR4) id AA09331; Wed, 6 Sep 1995 14:57:14 -0400 Old-Return-Path: Resent-Date: Wed, 6 Sep 1995 12:00:41 -0700 Old-Return-Path: From: schaefer@z-code.com (Barton E. Schaefer) Message-Id: <950906120041.ZM4788@zyrcon.z-code.com> Date: Wed, 6 Sep 1995 12:00:41 -0700 In-Reply-To: Zefram "Re: maintaining init files on a [t]csh influenced system" (Sep 6, 7:33pm) References: <28279.199509061833@stone.dcs.warwick.ac.uk> Reply-To: schaefer@z-code.com X-Face: czU|*h"p8AX?4.I.yU.^s%TIMx|"-s,*'|#H^|e,QjE&!jL%<]:-.U/;khS%3a2BC5_d#)( mz=$$G0u9P&*N8cA~b[URf;lgKRif@#qEf[ltie#Gg0%6$b`e`k.Cgw:\qJx\\a7c(K7^3;gXW:e1@ J Subject: Re: maintaining init files on a [t]csh influenced system Cc: zsh-users@math.gatech.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-Id: <"ZwbtW.0.YH2.4yUJm"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/73 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Sep 6, 7:33pm, Zefram wrote: } Subject: Re: maintaining init files on a [t]csh influenced system } } >On the original question, though -- there are two major syntactic barriers } >to getting zsh to parse csh script files: } > } >1. "set" commands, because they can do any of: } > a. assign to multiple boolean options in a single command } > b. mix assignments of option variables with string assignments } > c. use spaces around the "=" sign in any string assignment } > } > set noclobber history = 50 nonomatch prompt="`hostname`: " } > } >2. the "$?variable" syntax for testing whether a variable is set } > } >You can get zsh to parse just about everything else (*) by clever use of } >aliases and zsh functions, but I haven't figured out a workaround for } >either of the above. } } $?variable would have to be supported by zsh itself, and would conflict } with the normal use of $?. Yup. } I think you could define a set function } that would do everything required, though. (Check if argument is an } option and set it if so, check for separated = signs and join together } arguments as required. It's actually not too difficult to write.) I suspect that if you wrote it, I could break it using something that would be legal csh syntax. I do agree that you can cover most of the common cases. Oh, I thought of a third serious syntax problem: History syntax in aliases. I shouldn't have forgotten that one, it's even mentioned in the section that I contributed to the FAQ. :-} } >(*) "switch" statements are VERY entertaining, but possible (I think); } > anybody care to guess how? } } Please enlighten us. It starts out with something like: alias switch='cat >! /tmp/sw$$ <<\endsw ; doswitch' And finishes up with a doswitch() function that reads the temporary file and looks for the case ... breaksw block matching the function params. -- Bart Schaefer Vice President, Technology, Z-Code Software schaefer@z-code.com Division of NCD Software Corporation http://www.well.com/www/barts