SUMMARY: exec of tcsh in .cshrc and CDE

Walter Moore (wbmoore@fedex.com)
Fri, 21 Mar 1997 07:36:21 -0600

Original problem:
========
we are consolidating multiple environments into one supportable environment.
I have some users who are used to running tcsh, but it will not be a supported
shell. The question is, how can the user's check to see if they are NOT
using tcsh, then if it exists, exec it? I have this tidbit, but when used
with CDE, it kicks the user right back out. So I guess I need a test to see
if its the first csh within CDE, if so do not exec it. any ideas how to do
this?

==
if ( $?tcsh == 0 ) then # ie not set (ie I am csh)
if ( -f /bin/tcsh ) then
exec /bin/tcsh
endif
endif
==
=======
someone suggested consolidating onto tcsh, but the choice is not mine to make.

someone suggested testing to see if its on the console before testing
for tcsh - that didnt work.

someone else suggested testing for DT, but even after uncommenting the
DTSOURCEPROFILE=true in the .dtprofile, it didnt work.

someone else suggested testing for interactive_shell, which was close
to what I ended up doing.

The solution was
# if interactive user and tcsh is not set (ie, I am csh) then exec tcsh
if ( ${?USER} && ${?prompt} && "${?tcsh}" == 0 ) then
if ( -f /bin/tcsh ) then
exec /bin/tcsh
endif
endif

thanks all!

Walter Moore