- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: stty: : Not a typewriter
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2002 08:52 PM
09-11-2002 08:52 PM
I am running a script through cron and I am receiving "stty: : Not a typewriter" message in my mail. Could anyone please assist.
Below is a list of stty commands in my profile.
###############################################
stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z"
[[ $TERM = vt220 ]] && stty erase "^?"
[[ $TERM = vt200 ]] && stty erase "^?"
stty hupcl ixon ixoff
tabs
###############################################
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2002 09:14 PM
09-11-2002 09:14 PM
SolutionThe error messages are telling you that you are trying to set up a terminal environment when there isn't one to set up - you are running your script from "cron".
The messages are harmless but you could maybe check in your .profile if it is being run from cron by using:
echo "$-"
and if there is an "i" in the returned string then the shell is interactive.
Hope this helps,
Ollie.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2002 09:55 PM
09-11-2002 09:55 PM
Re: stty: : Not a typewriter
The job run by cron do not assiociate with a terminal so the stty command will be failed when called. You can just skip it.
But if you want to define the stty command in your profile, you can make some checking before issue the command.
== Begin
tty > /dev/null
rc=$?
if [ $rc -eq 0 ]
then
stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z"
[[ $TERM = vt220 ]] && stty erase "^?"
[[ $TERM = vt200 ]] && stty erase "^?"
stty hupcl ixon ixoff
tabs
fi
== End
Regards,
Patrick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2002 05:05 AM
09-12-2002 05:05 AM
Re: stty: : Not a typewriter
You can protect the commands with:
if [ -o interactive ]
then
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2002 04:20 PM
09-12-2002 04:20 PM
Re: stty: : Not a typewriter
Thanks for the response.
I have changed the .profile to look like this.
###############################################
tty > /dev/null
rc=$?
if [ $rc -eq 0 ]
then
stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z"
[[ $TERM = vt220 ]] && stty erase "^?"
[[ $TERM = vt200 ]] && stty erase "^?"
stty hupcl ixon ixoff
tabs
fi
###############################################
Now I am experiencing a different problem with the script.
stty: : Not a typewriter
/u/script
cannot create
stty: : Not a typewriter
From what I can see from the script its trying to redirect output to a logfile but its experiencing problems creating it.
The command being used is below,
exec >> $directory/$logfile 2>> $directory/$logfile
Although the script is not interactive can I not create a logfile? Do I have to set a different tty setting if its not interactive?
Your help is much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2002 05:47 PM
09-12-2002 05:47 PM
Re: stty: : Not a typewriter
Of course you can create any logfile in a script either by command execution or cron.
The command you run is going to append to a log as you use '>>'. Then what is the owner of that file ? Can you have the permission to write on it ?
Regards,
Patrick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2002 06:41 PM
09-12-2002 06:41 PM
Re: stty: : Not a typewriter
Many Thanks