The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
stty: tcgetattr: A specified file does not support the ioctl system call. vishal_ranjan UNIX for Advanced & Expert Users 9 05-30-2007 01:29 AM
stty tcgetattr errors Student37 UNIX for Dummies Questions & Answers 8 04-26-2007 10:02 AM
not a typewriter error jxh461 UNIX for Advanced & Expert Users 2 01-23-2006 12:43 PM
stty frank UNIX for Dummies Questions & Answers 1 11-08-2002 07:49 AM
stty: : Not a typewriter yls177 UNIX for Dummies Questions & Answers 4 11-06-2002 05:08 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-17-2002
Registered User
 

Join Date: Jan 2002
Posts: 5
Stumble this Post!
stty: tcgetattr: Not a typewriter

I'm using some shell script to do some routine checks on system. I put them in crontab. Every time script run, I'm getting strange mails:
Code:
Message-Id: <200201171232.AA26410@odb.odl.com>
Apparently-To: root

stty: tcgetattr: Not a typewriter
Not a terminal
stty: tcgetattr: Not a typewriter
stty: tcgetattr: Not a typewriter
Not a terminal
stty: tcgetattr: Not a typewriter
stty: tcgetattr: Not a typewriter


*************************************************
Cron: The previous message is the standard output
      and standard error of one of your cron commands.
My question is what command produces this messages, and how to get rid of them?

Thanks

Script:
Code:
#oracle path
OBIN="/u05/z05/app/oracle/product/7.3.4/bin"

# Path to configuration files
CFG_DIR="/u05/z05/app/oracle/product/7.3.4/db_mgmt/alert_scripts"

# List of non-default quotes from configuration file
QT=`cat $CFG_DIR/alert_tbs_quotes.cfg | awk '$1 !~ /#/ {print $1 " " $2 "~"}`

# Default limit of free space%
DFLT_PERC=20

i=0

add_msg()
{
  i=$(($i+1))

  MSG="${MSG}
$1 has $2% of free space, what is less than $3% safe quote.
It has to be expanded by ${5}MB from current ${4}MB to get above the quote.
"
}

# calculate data about tablespaces from Oracle
{
$OBIN/sqlplus -s $PWD <<EOF
set linesize 500
set pagesize 0
set verify off
set feedback off
select f.tablespace_name||' '||to_char(round(sum(free)/sum(total)*100))
||' '||to_char(sum(total))||' '||to_char(sum(free)) from
(select tablespace_name, file_id, sum(bytes) free from dba_free_space
 group by tablespace_name, file_id) f,
(select file# file_id, bytes total from v\$datafile) z
where z.file_id=f.file_id group by tablespace_name order by 1;
exit
EOF
} \
| \
{
while read TBS PERC SIZE FREE
do
  # trying to look for quotes in configuration file
  LMT=` print $QT | awk -v RS="~" -v T="$TBS" '{ if ( $1 == T )
   print $2}'`
  LMT=${LMT:-$DFLT_PERC}
  if (( $PERC < $LMT )); then
    add_msg "$TBS" "$PERC" "$LMT" "$(($SIZE/1024/1024))" "$(( ($SIZE*$LMT-$FREE*100)/(100-$LMT)/1024/1024))"
  fi
done
}

if [[ -n ${MSG:+1} ]]; then
MSG="This message was generated by alert notification system.
Tablespace(s) below has exceed free space quote and needs to be expanded.
You can specify special quote for particular tablespaces in
file $CFG_DIR/alert_tbs_quotes.cfg.
${MSG}
Have a nice day!"

/usr/bin/perl /u04/z04/home/email/send_email.perl  \
-from "OAPROD UNIX-BOX <odl@odl.com>" -to "$1" -subject "Tablespace(s) Alert" \
-text "$MSG"
fi
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-17-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,449
Stumble this Post!
The error message tells you that the program is "stty". I don't see any "stty" stuff in that fragment of your script. But the usual cause is that someone is sourcing .profile in cronjob.

I think that scripts should stand on their own and comepletely define the environment as needed. But the .profile could be modified to only invoke stty if the shell is interactive.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0