Sponsored Content
Top Forums Shell Programming and Scripting Calling Expect Script - Telnet Post 302548045 by trinak96 on Wednesday 17th of August 2011 10:22:27 AM
Old 08-17-2011
Yes, that's the error I posted originally. It's the spawn telnet $device command which works when run with manual IP but fails when called from control script.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling an Expect script from a Webpage using PHP

I have a webpage that is in HTML and PHP. In PHP I have tried using exec, system, shell_exec and passthru functions to call an Expect Script file (temp.exp). This Expect file spawns a telnet session that uses "expect/send" commands to retrieve information from an environmental unit (not a normal... (0 Replies)
Discussion started by: CCUSmith
0 Replies

2. Shell Programming and Scripting

Calling Expect script in Perl...

I call a EXPECT script from my perl script with machine IP and a FIle. The script logins to the machine and exports the value. The values to be exported or stored in a file. I have close to 10 machines and I have created 10 files and pass the corresponding files in command line, Now I could like... (4 Replies)
Discussion started by: ramkriz
4 Replies

3. Shell Programming and Scripting

Telnet Expect script question

Hi all, I have written a small expect script which should spawn a telnet session login and execute some commands. #!/usr/bin/expect -f spawn telnet $env(IP) match_max 100000 expect "login:" send -- "******\n" expect -exact "Password:" send -- "****\n" expect "%" Now I have got... (2 Replies)
Discussion started by: stinkefisch
2 Replies

4. Shell Programming and Scripting

calling expect script in ksh is failing via cron

I'm calling an expect script via a ksh script in cron and it is failing. The script runs fine if i run it manually. Does anyone know if it is an issue with compatibilty and if there is a way around it? (2 Replies)
Discussion started by: bhatia
2 Replies

5. Shell Programming and Scripting

ssh is not working while calling through expect shell script

Hi, Please share you experience and way out on below error:--> #!/bin/bash -xv FILE=login.txt + FILE=login.txt CONNECT=sshlogin.exp + CONNECT=sshlogin.exp SERVERNAME=$1 + SERVERNAME=192.168.12.1 MyServer="" + MyServer= MyUser="" + MyUser= MyPassword="" + MyPassword= exec 3<&0 +... (6 Replies)
Discussion started by: manish_1678
6 Replies

6. Shell Programming and Scripting

Calling Shell Script from Expect...

Hi there, I need some help regarding the execution of shell script from expect as the method I am trying is giving me error. I wrote an shell program which takes two arguments to telnet to a device and saves the output in a file. Following is the script.... (0 Replies)
Discussion started by: cyberparanoid
0 Replies

7. Shell Programming and Scripting

Calling a function which uses expect from a shells script

Hi all, This is the first time i am using expect. I am trying to call a function with in the shell script. The function will shh to a new server and will pass the password using expect and send. I need help in calling the fuction i am getting follaowing errors... here the script ... (8 Replies)
Discussion started by: firestar
8 Replies

8. 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

9. 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

10. Shell Programming and Scripting

Password check in bash script calling on expect

password check in bash script calling on expect Background: I have to copy a file from one server, to over 100 servers in a test environment. once the file is copied, it requires to have the permissions on the file changed/verified. These are all linux servers. most of them have the same... (1 Reply)
Discussion started by: 2legit2quit
1 Replies
posix_spawnattr_destroy(3C)				   Standard C Library Functions 			       posix_spawnattr_destroy(3C)

NAME
posix_spawnattr_destroy, posix_spawnattr_init - destroy and initialize spawn attributes object SYNOPSIS
#include <spawn.h> int posix_spawnattr_destroy(posix_spawnattr_t *attr); int posix_spawnattr_init(posix_spawnattr_t *attr); DESCRIPTION
The posix_spawnattr_destroy() function destroys a spawn attributes object. A destroyed attr attributes object can be reinitialized using posix_spawnattr_init(). The results of otherwise referencing the object after it has been destroyed are undefined. An implementation can cause posix_spawnattr_destroy() to set the object referenced by attr to an invalid value. The posix_spawnattr_init() function initializes a spawn attributes object attr with the default value for all of the individual attributes used by the implementation. Results are undefined if posix_spawnattr_init() is called specifying an already initialized attr attributes object. A spawn attributes object is of type posix_spawnattr_t (defined in <spawn.h>) and is used to specify the inheritance of process attributes across a spawn operation. No attributes other than those defined by IEEE Std 1003.1-200x are provided. The resulting spawn attributes object (possibly modified by setting individual attribute values), is used to modify the behavior of posix_spawn(3C) or posix_spawnp(3C). After a spawn attributes object has been used to spawn a process by a call to posix_spawn() or posix_spawnp(), any function affecting the attributes object (including destruction) will not affect any process that has been spawned in this way. RETURN VALUES
Upon successful completion, posix_spawnattr_destroy() and posix_spawnattr_init() return 0. Otherwise, an error number is returned to indi- cate the error. ERRORS
The posix_spawnattr_init() function will fail if: ENOMEM Insufficient memory exists to initialize the spawn attributes object. The posix_spawnattr_destroy() function may fail if: EINVAL The value specified by attr is invalid. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
posix_spawn(3C), posix_spawnattr_getflags(3C), posix_spawnattr_getpgroup(3C), posix_spawnattr_getschedparam(3C), posix_spawnattr_getsched- policy(3C), posix_spawnattr_getsigdefault(3C), posix_spawnattr_getsigmask(3C), attributes(5), standards(5) SunOS 5.11 30 Jan 2004 posix_spawnattr_destroy(3C)
All times are GMT -4. The time now is 11:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy