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

Re: maintaining init files on a [t]csh influenced system

On Sep 6, 10:16am, Toshi Isogai wrote:
} Subject: Re: maintaining init files on a [t]csh influenced system
} On Wed, 6 Sep 1995, Andrew Eskilsson wrote:
} > Are there any possibilities to let zsh run the global [csh] files and
} > incorporate the freshly set variables into the shell?
} I am in the same situation and what I did was setting my login
} shell back to csh and at the end of my .cshrc (or .login) I added
} 	exec zsh

Yup, I do the same thing.  Proper startup of the IRIX 4 desktop is pretty
heavily wired into having csh (or sh) as your login shell.  My .cshrc on
IRIX 4 machines actually looks (in part) like this:


# Figure out if this login is from XDM on the console
setenv TTY "`tty`"
if ($?DISPLAY) then
    if ($DISPLAY == :0) then
	if (! $?CONSOLE_LOGIN) then
	    setenv CONSOLE_LOGIN "$TTY"
    setenv WINTERM xterm
    setenv XHOST `hostname`
if ($?CONSOLE_LOGIN) then
    if ("$CONSOLE_LOGIN" != "$TTY") then

# If this is not the XDM console and is interactive, run zsh
if (! $?CONSOLE_LOGIN && $?prompt) then
    if (! $?SHLVL) then
	exec /usr/local/bin/zsh -l
	exec /usr/local/bin/zsh


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.

(*) "switch" statements are VERY entertaining, but possible (I think);
    anybody care to guess how?

Bart Schaefer                     Vice President, Technology, Z-Code Software
schaefer@xxxxxxxxxx                  Division of NCD Software Corporation

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