* Why does this not work in zsh?
@ 1995-09-13 3:58 Thomas Schafbauer
1995-09-13 9:01 ` Zefram
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Schafbauer @ 1995-09-13 3:58 UTC (permalink / raw)
To: zsh-users
Below follows a nice script, which works with ksh, bash, csh and tcsh,
but not with zsh :-((((
The variable shname is set in .profile/.cshrc/.tcshrc etc.
I really like it (and it was a pain to comfort all shells), but zsh
is compatible to nothing in this respect :-)
Bye
Thomas
# this works for ksh + csh shells, when the following variables are defined
if ( `test $shname = ksh -o $shname = bash -o $shname = zsh` ) then
shfun=1 # K-Shells supports shell-functions
Ali() { alias $1="$2" ; }
alias endif=":"
else
set shfun=0; # C-Shell like do not support shell-funcs
alias Ali alias
alias fi :
alias setopt set # so we set options in Cshell like in ZShell
alias unsetopt unset
setopt noglob # do not allow filename expansion right now
endif
fi
if ( `test $shname = zsh` ) then
setopt noglob # do not allow filename expansion right now
alias fi=:
endif ; fi
####### Regular Aliases #######
# Safety
Ali cp 'cp -i' # prompt before overwriting file
Ali mv 'mv -i' # prompt before overwriting file
Ali rm 'rm -i' # prompt before removing file
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Why does this not work in zsh?
1995-09-13 3:58 Why does this not work in zsh? Thomas Schafbauer
@ 1995-09-13 9:01 ` Zefram
0 siblings, 0 replies; 2+ messages in thread
From: Zefram @ 1995-09-13 9:01 UTC (permalink / raw)
To: Thomas Schafbauer
>Below follows a nice script, which works with ksh, bash, csh and tcsh,
>but not with zsh :-((((
>if ( `test $shname = ksh -o $shname = bash -o $shname = zsh` ) then
> shfun=1 # K-Shells supports shell-functions
> Ali() { alias $1="$2" ; }
> alias endif=":"
[...]
>if ( `test $shname = zsh` ) then
> setopt noglob # do not allow filename expansion right now
> alias fi=:
>endif ; fi
Erm, in zsh, you're aliasing both endif and fi to :. I'm not surprised
that it doesn't work. Don't alias fi if you're using zsh.
-zefram
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1995-09-13 9:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-09-13 3:58 Why does this not work in zsh? Thomas Schafbauer
1995-09-13 9:01 ` Zefram
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).