Mac telnet client seems to skip part of login script?

I have no idea how but it seems like a mac telnet client is skipping part of our login script.  We use tcsh and at the bottom of .login I have a section that executes and asks some questions and drops a person in some software instead of a command prompt.  But I see the person at the command prompt instead.

Any ideas?
XetroximynAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Duncan RoeSoftware DeveloperCommented:
Sounds like something in the environment exported by the Mac. Would need to see your .login to say any more.
0
XetroximynAuthor Commented:
Here is the most relevant section that seems to be skipped

if ($USER == "client") then
    fixsuper
    fixsuper
    fixsuper
    cd /usr/cfmc/jobs
    clear
    tryagain:
    set jobfolder = ""
    echo    " "
    echo    " "
    echo    "   Please enter the JOB FOLDER from the instructions"
    echo    " "
    echo    "   or type 'abort' to logout"
    echo    " "
    echo -n " --> "
    set jobfolder = `head -1`
    if ( `echo ${jobfolder} | grep -c "abort"` ) then
        logout
    endif
    if ( ${jobfolder} == "" ) then
        clear
        goto tryagain
    endif

    set studycode = ""
    echo    " "
    echo    " "
    echo    "   Please enter the STUDY CODE from the instructions"
    echo    " "
    echo    "   or type 'abort' to logout"
    echo    " "
    echo -n " --> "
    set studycode = `head -1`
    if ( `echo ${studycode} | grep -c "abort"` ) then
        logout
    endif
    if ( ${studycode} == "" ) then
        clear
        goto tryagain
    endif

    if ( { ls /usr/cfmc/jobs/${jobfolder} } == "1" ) then
        clear
        cd ${jobfolder}
        if ( { ls /usr/cfmc/jobs/${jobfolder}/test } == "1" ) then
            clear
            cd test
            survent "init:${studycode};dbug;yes"
        else
            clear
            netsurv "init:${studycode};dbug;yes"
        endif
    else
        clear
        echo    " "
        echo    " It appears that job does not exist on the system"
        echo    " "
        echo    " Check the instructions and try again"
        echo    " "
        echo    " If you continue to have issues let us know"
        echo    " "
        echo    " "
        goto tryagain
    endif
    echo    " "
    echo    " "
    echo    " press enter to logout"
    echo    " "
    set logout = `head -1`
    logout
endif

Open in new window

0
ozoCommented:
shouldn't that be
if [ $USER == "client" ] ; then
0
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

XetroximynAuthor Commented:
This is actually csh/tcsh which has different IF syntax than bash.  Also this code works fine when people telnet from windows... but not mac.
0
Duncan RoeSoftware DeveloperCommented:
Get the output from the env command on the mac. Validate that no items in that output match shell variables that your script tests. (USER is probably all right but do verify it is what you expect in the logged-in session).
Failing that, please post the entire .login script. Also env output from the Mac.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TintinCommented:
The telnet client should have no influence on the login shell and any subsequent scripts run.

The only thing that I can think of that would affect the ability to run the script is if the assumptions about environment variables is incorrect.
0
Duncan RoeSoftware DeveloperCommented:
@Tintin: sorry I don't understand your last post. A telnet client can export environment variables to a server using IAC 36 in telnet protocol as per RFC 1408
I suspect the Mac is sending a variable with a name that .login assumes to be unset.
0
XetroximynAuthor Commented:
Thanks!  Iam trying to get the mac user to list their env so I can check
0
Duncan RoeSoftware DeveloperCommented:
You could put a line at the head of .login such as env>/tmp/$PPID.env - that will tell you all you need to know. (The process ID will be that of the in.telnetd invocation)
0
XetroximynAuthor Commented:
hmmm... seems it does not work.  If I login, no file is made.  If i do
source .login
in an existing window a file is made... any ideas?
0
Duncan RoeSoftware DeveloperCommented:
Not executing .login may be your problem. man tcsh tells me that it ought to be executed, at least if your login shell (in /etc/passwd) is /bin/tcsh or /bin/csh. Users may change their login shells using chsh - you might want to check that they haven't done that.

env>/tmp/$PPID.env is bash syntax - maybe you need to adjust for tcsh? But you did say it worked when you sourced it.
0
XetroximynAuthor Commented:
dur... So there are a number of users that share a login script... I forgot I recently separated my user from that, so I was not using the login script... it is in fact working.   Now I just need to get a mac user to login... (they are so rare.... most of our clients use windows)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.