Operating System - HP-UX
1820884 Members
3587 Online
109628 Solutions
New Discussion юеВ

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

 
Alex_17
Frequent Advisor

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

Hi,

when I execute the following

su - oracle "-c sqlplus system@RECP /tmp/RECP/usuarisRECP.sql" << EOF

EOF

I get the message:

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

Any idea??.

Thanks in advance.

Alex.
5 REPLIES 5
Rita C Workman
Honored Contributor

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

I'm no programmer, but looks like your trying to use C an get a password, within your code.

So take a look at this thread, I think it might help you,

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x1300a22d6d27d5118fef0090279cd0f9,00.html

Rita
Alex_17
Frequent Advisor

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

Hi Rita,

I'm not trying to mask a password into a C program. What I do is a script with te SU command:

su - oracle "-c sqlplus system@RECP @/tmp/RECP/usuarisRECP.sql" << EOF
manager
EOF

and I give the password (manager) for the sqlplus command. I do this to avoid showing the password if anyone writes pas -ef.

Thanks.

Alex.
burns
New Member

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

I had the same error.

The cause was an entry in the glogin.sql file.

There was a

!stty erase ^H
hiding in there.

A. Clay Stephenson
Acclaimed Contributor

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

Hi:

Your problem is that your are sourcing oracle .profile with your su - oracle. You can fix this in two ways:

1) Continue to use su - oracle ... BUT enclose any interactive commands such as tset, tabs, stty ... with
if [ -t 0 ]
then
stty ..
tabs
fi

This will skip over those commands if non in an interactive environment.

2) Preferred
Create a file, e.g. /usr/local/bin/oraenv.sh
and in it set and export all your needed ORACLE variables and PATHS. DO NOT put an exit statement in this file. You then source /usr/local/bin/oraenv.sh like this
. /usr/local/bin/oraenv.sh
in both Oracle's .profile and in whatever command you execute. Your command then becomes su oracle .... (no dash). This way interactive sessions and non-interactive sessions always have the same environment.
If it ain't broke, I can fix that.
MANOJ SRIVASTAVA
Honored Contributor

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

Hi Alex


Try this I think you are putting a -c after the paranthesis:



su - oracle -c " sqlplus system@RECP /tmp/RECP/usuarisRECP.sql" << EOF


Manoj Srivastava