Not a terminal

Please see the error we are getting for the script
Not a terminal
stty: : Not a typewriter
stty: : Not a typewriter
^M^M    ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2     ^[2^M
                                                                 ^M/usr/lib/ Can't open shared library: /project2/OES/634/src/oes/src/lib/
/usr/lib/ No such file or directory
/usr1/local/bin/nsrpre_express_backup[9]: 28180 Abort(coredump)

How can we get rid of the "Not a Terminal"?
1. We are running a cronjob script
30 00 * * * /usr1/local/bin/ > /tmp/stop_start_.log 2>&1
2. The contains
# Procedure to stop/start instance on the weekends
sleep 300

3. /home/user1/.profile contains
# @(#)B.11.11_LR

# Default user .profile file (/usr/bin/sh initialization).

# only execute if interactive session

# Set up the terminal:
        if [ "$TERM" = "" ]
                eval ` tset -s -Q -m ':?hp' `
                eval ` tset -s -Q `
        stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z"
        stty hupcl ixon ixoff
export ORACLE_BASE=/usr1/oes
sleep 600
# Stop the first instance of Express
/usr1/oes/ stop immediate ExpSrv634
sleep 120
# Stop the second instance of Express
/usr1/oes/ stop immediate ExpSrv634_1
# Allow 2 minutes for both the instances to stop.

Please advise

Who is Participating?
DavidSenior Oracle Database AdministratorCommented:
This is caused by the 'stty' settings you have in your user profile (either ~/.profile or /etc/profile).  Try commenting them out and then login again.

Some people put stty commands in their startup scripts (.profile for ksh). Ideally, they should test to see if the shell is interactive.

oo07Author Commented:
we need the .profile to set the environment
DavidSenior Oracle Database AdministratorCommented:
Perhaps if you tried adding to your .profile the line ENV=~/.shrc  where .shrc contains your aliases and stty settings....
you may add an if statement in your .profile that checks your TERM env variable before calling stty
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.