Sponsored Content
Top Forums Shell Programming and Scripting strange expect script behavior, or am i misunderstanding expect scripting? Post 302266572 by Perderabo on Wednesday 10th of December 2008 02:50:36 PM
Old 12-10-2008
I'm not an expect expert, but stty should be no problem. You probably have a bug somewhere else. The only thing with stty is that you're supposed to use the builtin in stty:
Do not do this: exec stty -echo
Do this: stty -echo

It says here, in my expect book, that the reason is that stty is not standard. I have found stty to be standard for stuff like this, but I would follow the book's technique anyway.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Misunderstanding of sort behavior

Hi everyone, I use the sort from the 5.3.0 coreutils package. I have a file consisting in 5 fields separated by a single space, with no leading or trailing blanks. I want to sort it first according to the 4th field, which contains integers (some of them negative), and secondly on the second... (2 Replies)
Discussion started by: chlorine
2 Replies

2. UNIX for Dummies Questions & Answers

Strange expect problem

Hi I'm writing a script which calls an expect script to retrieve configuration files for network devices. I want to avoid using TFTP to transfer the configs if possible and so I'm redirecting the screen output to a text file. This is the expect script: #!/usr/local/bin/expect set... (2 Replies)
Discussion started by: Ant1815
2 Replies

3. Shell Programming and Scripting

Expect Scripting Help

Hi All, I am trying to connect a router using Expect scripting. But my script shows error.One more thing after the command telnet localhost 2000 we should press ENTER KEY once before the command prompt asks for "enable" and password.Please help correctiong my script. #!/usr/bin/expect -- ... (2 Replies)
Discussion started by: Harikrishna
2 Replies

4. Shell Programming and Scripting

Need help with Expect script for Cisco IPS Sensors, Expect sleep and quoting

This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
Discussion started by: genewolfe
1 Replies

5. Shell Programming and Scripting

Expect script strange behaviour

Hi people, I'm having some strange behaviour with an 'expect' script. spawn csession blah expect "Username: " send "userblah\r" expect "Password: " send "passwordblah\r" interact When I execute the script as root it runs perfectly. However, when executed as any other... (0 Replies)
Discussion started by: GarciasMuffin
0 Replies

6. Programming

Calling expect script inside another expect

Hi, Am very new to expect scripting.. Can You please suggest me how to call an expect script inside another expect script.. I tried with spawn /usr/bin/ksh send "expect main.exp\r" expect $root_prompt and spawn /usr/bin/ksh send "main.exp\r" expect $root_prompt Both... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies

7. Programming

Calling another expect script inside an expect script

I have an expect script called remote that I want to call from inside my expect script called sudoers.push, here is the code that is causing me issues: set REMOTE "/root/scripts/remote" ... log_user 1 send_user "Executing remote script as $user...\n" send_user "Command to execute is: $REMOTE... (1 Reply)
Discussion started by: brettski
1 Replies

8. IP Networking

IP and expect scripting

Hi I am new to IP configuration and using expect script I have a requirement like I need to write a expect script that can ssh to a remote machine(linux1) using password which already has IP, once logged inside machine need to reboot remote machine(linux1) and again login to same remote... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies

9. Programming

Expect script returning string following a found expect.

I'm fairly new to scripting so this might not be possible. I am using Expect with Cisco switches and need to capture the string after finding the expect request. For example, when I issue "show version" on a Nexus switch, I'm looking to capture the current firmware version: #show version ... (0 Replies)
Discussion started by: IBGaryA
0 Replies

10. UNIX for Beginners Questions & Answers

Expect scripting issue, works interactively when doing commands in cli, does not work in script

Hi; problem may be obvious, simple but I have to say it is somehow not easy to locate the issue. I am doing some word extracting from multiline text. Interacting in CLI seems to work without issues. First step is to add multiline text to a variable. expect1.1> expect1.1> set... (2 Replies)
Discussion started by: aldowski
2 Replies
IOCTL(2)							System Calls Manual							  IOCTL(2)

NAME
ioctl, stty, gtty - control device SYNOPSIS
#include <sgtty.h> ioctl(fildes, request, argp) struct sgttyb *argp; stty(fildes, argp) struct sgttyb *argp; gtty(fildes, argp) struct sgttyb *argp; DESCRIPTION
Ioctl performs a variety of functions on character special files (devices). The writeups of various devices in section 4 discuss how ioctl applies to them. For certain status setting and status inquiries about terminal devices, the functions stty and gtty are equivalent to ioctl(fildes, TIOCSETP, argp) ioctl(fildes, TIOCGETP, argp) respectively; see tty(4). The following two calls, however, apply to any open file: ioctl(fildes, FIOCLEX, NULL); ioctl(fildes, FIONCLEX, NULL); The first causes the file to be closed automatically during a successful exec operation; the second reverses the effect of the first. SEE ALSO
stty(1), tty(4), exec(2) DIAGNOSTICS
Zero is returned if the call was successful; -1 if the file descriptor does not refer to the kind of file for which it was intended. BUGS
Strictly speaking, since ioctl may be extended in different ways to devices with different properties, argp should have an open-ended dec- laration like union { struct sgttyb ...; ... } *argp; The important thing is that the size is fixed by `struct sgttyb'. ASSEMBLER
(ioctl = 54.) sys ioctl; fildes; request; argp (stty = 31.) (file descriptor in r0) stty; argp (gtty = 32.) (file descriptor in r0) sys gtty; argp IOCTL(2)
All times are GMT -4. The time now is 03:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy