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

Why does this not work in zsh?



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










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