Visit Our UNIX and Linux User Community


stty: tcgetattr: A specified file does not support the ioctl system call


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting stty: tcgetattr: A specified file does not support the ioctl system call
# 1  
Old 12-16-2010
stty: tcgetattr: A specified file does not support the ioctl system call

Hi Gurus,

I have scheduled a script using cron scheduler. Script works fine when i run it manually. But it gives the following error in cron log.

Code:
stty: tcgetattr: A specified file does not support the ioctl system call.

I have given the following statement in cron.

Code:
0-59 * * * * /info/test/Scripts/check_num_proc.sh >> /tmp/check_num_proc_cron.log 2>&1

Please let me know what could be the problem.

Sam
# 2  
Old 12-16-2010
The problem is in here:
/info/test/Scripts/check_num_proc.sh

It does not have a controlling terminal, i.e., no /dev/tty, when it is run in cron.
If you do a stty coomand it will break, for example.

You can usually get around this with something like this.
Code:
if [  -f /dev/tty ] ; then
   # play with terminal settings here
fi

# 3  
Old 12-16-2010
I had this issue too. I'm guessing you run stty in the background. Try:

Code:
stty ... 2>/dev/null

# 4  
Old 12-16-2010
Thanks Jim.

I have removed the following statement from my .profile. The issue seems to be fixed now.

Code:
stty erase ^?

But is there a workaround for this. Without the above statement in .profile, It is annoying to use keys (shift +backspace) every time i type something wrong.

Regards
# 5  
Old 12-16-2010
I gave you the workaround - issue an stty inside an if statement that tests for the existence of /dev/tty. put that code in .profile
# 6  
Old 12-16-2010
Thanks Jim. will try that.

Regards

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Tcgetattr: Inappropriate ioctl for device

Hi, ssh -q -t -l $usr $host bin/test.sh I am using above command to run script remotely. script is working without any issues. but I am getting "tcgetattr: Inappropriate ioctl for device" message on console. plz help how can I avoid this message. Thanks Moved thread from Emergency... (1 Reply)
Discussion started by: Kri
1 Replies

2. Shell Programming and Scripting

tcgetattr: Inappropriate ioctl for device after ssh command

Hello everyone I am finishing a script allowing me to purge logs on multiple servers, i have one last pb with the ssh command.........it is throwing me the following error : tcgetattr: Inappropriate ioctl for device (full screen in attached file 1, full script in attached file 2) It... (15 Replies)
Discussion started by: jimmy75_13
15 Replies

3. Programming

how to call dot c file using system command

Hi every one, i have to dot pc files. One have main function but one dont have.I have to call dot pc file using system () cmd.File is being call have main function.Please let me know how i can call .pc file with two arguments from other dot pc file.I want some thing like sprintf(buf, "ss_xxx.pc... (4 Replies)
Discussion started by: goraya430
4 Replies

4. Shell Programming and Scripting

how to call dot c file using system command

Hi every one, i have to dot pc files. One have main function but one dont have.I have to call dot pc file using system () cmd.File is being call have main function.Please let me know how i can call .pc file with two arguments from other dot pc file.I want some thing like sprintf(buf,... (1 Reply)
Discussion started by: goraya430
1 Replies

5. SCO

stty: tcgetattr failed

I was using i/o8+ serial (with baud 9600,4800 & 1200)without any problem after uninstalling the above card I installed ultraport8i serial card of the same Oem I am getting the error message stty: tcgetattr failed: inappropriate I/O control operation (error 25) please help::confused: (0 Replies)
Discussion started by: aak
0 Replies

6. UNIX for Advanced & Expert Users

ioctl() system call on Linux-i386

Greetings, Please help me with the following : Where can I find what means exactly and how to use each of the second argument of the ioctl() system call in Linux/386 : FIOxxx (file IOCTL requests), SIOxxx (socket IOCTL requests), TCxxx TIOxxx (terminal IOCTL requests) ? ... (1 Reply)
Discussion started by: aigoia
1 Replies

7. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

8. UNIX for Advanced & Expert Users

stty: tcgetattr: A specified file does not support the ioctl system call.

Hi, I am trying to implement SSH between two systems say ukblx151 & ukapx047 with ID say khzs228, i follow the following process: Step-1) $ ssh-keygen -t rsa -f rsa Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your... (9 Replies)
Discussion started by: vishal_ranjan
9 Replies

9. UNIX for Dummies Questions & Answers

stty tcgetattr errors

Hi, I have an app that runs Oracle 8.1.7 residing on a AIX 4.3 ML 10 . preiodically app sends out a status log like the one displayed below. Lately I have noticed this stty:tcgetattr message in the log. Script that writes this output calls sqlplus, gets the required count and writes output to... (8 Replies)
Discussion started by: Student37
8 Replies

Featured Tech Videos