Wierd behaviour setting stty echo


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Wierd behaviour setting stty echo
# 1  
Old 05-19-2009
Wierd behaviour setting stty echo

Hi all,

Encountered a wierd behaviour which I am unable to understand.

I have a function doing the follow:

function RETRIEVE_PASSWORD
{
if (( $DC_ACCOUNT ))
then
clear
printf "\nEnter Password for ${ConfiguredUser}"
printf "\nPassword: "
stty -echo
read -r DCAcctPwdPart1
fi
}

Problem is that, when I call this function from the main program, it works fine. But when I call it from within another function, it breaks giving me the error:

unable to set stty

It doesn't wait for user input...

Read some information regarding the interactive mode, I planted echo $- in different part of the code, but all returned "h"

What am I missing here. Thanks for any input and opinion.

Regards
Eugene
# 2  
Old 05-19-2009
Forgot to add on, the function was called from a while loop:

cat user.cfg | while read LINE
do
RETRIEVE_PASSWORD
done
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Behaviour of echo commands used by Linux admins

version info : Fedora 28 (Kernel version: 4.16.12-300) shell : bash Using echo command , if I redirect a text like "Chocolate" to a file , all the contents in the file are overwritten as shown below. # cat /tmp/someTest Hello world One more Hello world myLine3 # echo... (4 Replies)
Discussion started by: kraljic
4 Replies

2. UNIX for Dummies Questions & Answers

STTY Columns Setting Environment Variable?

I am wondering about the following: stty columns 140 I have found that a number of times I need to set my display columns to a high number (such as 140) but I have to do this every time I login to use putty/ssh. Can we set this with an environmental variable so that it is permanent? Also... (4 Replies)
Discussion started by: newbie2010
4 Replies

3. AIX

which setting defines behaviour when paging space runs full ?

Hi, I have a bunch of AIX systems which usually have more than enough memory to live happily. Unfortunately we have on a few of our boxes an rman runaway problem - every now and than after restoring from rman backups, the process goes crazy and eats all memory it could possibly get hold off -... (0 Replies)
Discussion started by: zxmaus
0 Replies

4. Shell Programming and Scripting

Setting Echo Off

Hi How to set the ECHO off in shell scripts so that the default output will be hidden. (2 Replies)
Discussion started by: Joseph Antoine
2 Replies

5. Shell Programming and Scripting

setting width in echo statement

Hello All, I need to set the width or number of columns for my dynamic output in the echo statement. statement is like: echo " <output> " here the <output> is dyamice and can be of any number of characters, the " " should always start in same column everytime it is... (4 Replies)
Discussion started by: s123.radha
4 Replies

6. Programming

Wierd C program. Help Needed

Hi, Please see this: When i make a declaration as: char *i, j, *k; and then do sprintf( k, "print.sh %s", i ); the program works fine. But when i change the declaration to: char *i, *k; and then do sprintf( k, "print.sh %s", i ); I get a segmentation fault at the 'sprintf'... (16 Replies)
Discussion started by: karthikb23
16 Replies

7. UNIX for Dummies Questions & Answers

Wierd networking issue

I have Debian Etch release as a fresh install on a PIII to be a router/firewall. I've configured networking, and utilized Shorewall to set up iptables scripting. I've installed dhcp3, both client and server, to pull an ip from my broadband cable modem, and dish out ip's to a switch for other... (2 Replies)
Discussion started by: pflink
2 Replies

8. Solaris

wierd sparc 5

Hi! I own a sparc 5 and i seem to have a strange problem. When its off, it starts by itself... Sounds a bit strange? Iknow. Does anyone know whats causing this?? Could it be the network card? or is it someting in ENV or some other configuration?? //dOzY (5 Replies)
Discussion started by: dozy
5 Replies

9. Programming

Wierd pipe problem

I have encountered a strange problem dealing with pipes and forking. The program basicaly does this: cat file | tbl | eqn | groff Now, I have a parent process that forks children that that exec the stuff that they should. The pipes defined in the parent are the ones used. The chain goes... (1 Reply)
Discussion started by: denoir
1 Replies

10. UNIX for Dummies Questions & Answers

Wierd Message????

I am getting this message when I run my script. $ runscript.sh Not connected to any service! Here is the beginning of the script: # 1 - failure # # variable declaration FILEDATE=`date +"%Y%m%d"` Not connected to any service! Right after the FILEDATE gets loaded I get that... (6 Replies)
Discussion started by: lesstjm
6 Replies
Login or Register to Ask a Question