Sponsored Content
Top Forums Shell Programming and Scripting Can 'spawn' command be used more than once in an expect script ? Post 302475430 by DGPickett on Sunday 28th of November 2010 07:07:54 PM
Old 11-28-2010
Not sure, but it seems unnecessary - spawn ksh and do everything under that shell session.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expect: Beginner help with spawn and expect

Hello hello, did a quick search and didn't turn up anything helpful. I've got a book I'm sure has the answers, but I don't think I'll have time to finish it before this all has to work, so here goes~ if this isn't a good place to post and someone could direct me to another forum I'd appreciate... (1 Reply)
Discussion started by: Vryali
1 Replies

2. Shell Programming and Scripting

Expect: How to read buffer for spawn

Hi All, I have to write one expect script to login to one system. I am using set timeout -1 match_max 100000 spawn ssh root@hostname Now when I do spawn ssh to that host it send some warning message and one challenge Challenge: 111-2345 I need to read this challenge value and has... (1 Reply)
Discussion started by: Lokesh Agrawal
1 Replies

3. Shell Programming and Scripting

Expect Script Error invalid spawn id (6)

Hi everybody, We are trying to connect to a server and to a router using an .expect script that automatically authenticate the username and password needed. The error is that we cannot connect to the server using ssh AND we cannot connect to the router using either telnet or go commands from the... (1 Reply)
Discussion started by: omoyne
1 Replies

4. Shell Programming and Scripting

Using expect command, spawn will not start sftp process

Hi all, I have a script that runs sftp with expect so I can login and send a file in a cronjob. I've installed this on a couple other servers and it has been fine. However, this time on this machine, it seems to be giving me an issue. It won't move past the spawn sftp command and return a... (3 Replies)
Discussion started by: ltyrrell
3 Replies

5. Shell Programming and Scripting

Using spawn and expect getting error

#!/bin/sh # # set -x stty -echo; read -p "Input password:" A; stty echo; echo; for HOST in `cat elc.hosts.list` do # echo "Connecting to $HOST" expect -c "set timeout -1;\ spawn sshr $HOST -l root \"mkdir /perfstat;\";\ match_max 100000;\ expect *'/root/.ssh/id_dsa':*;\ send --... (1 Reply)
Discussion started by: madlot
1 Replies

6. Red Hat

Spawn: Command not found

Hi all, I want to run the following command from my main prompt : # spawn bash but I get the following error: spawn: Command not found. For this to work , I first have to go into expect. #expect expect1.1>spawn bash spawn bash 564 expect1.2> Is there any way I can skip the... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies

7. Shell Programming and Scripting

Error in spawn and expect for password

Code Broken!! "cod generator ip=$loja" expect -c " # set timeout -1 set timeout 18 spawn scp -C /etc/samba/arkivo.sh root@$loja:/etc/samba/ expect { -re "*yes/no*"{ send "yes\r" exp_continue } -re "*password:*" { send "senha\r" expect \"*#*\"}} ssh root@$loja expect \"*password:*\"... (4 Replies)
Discussion started by: hrenechen
4 Replies

8. Red Hat

Spawn: command not found

Dear Concern, I want to run following script in RHEL 6.3. $ cat sftp_upload.sh #!/usr/bin/expect spawn sftp -oPort=434 bkashtopup@172.16.252.59 expect "*?assword:*" send "bkashtopup1234\n" send "lcd /BI/application/report/script/daily/daily_bkash_itopup_detail\r" expect sftp> ... (3 Replies)
Discussion started by: makauser
3 Replies

9. Shell Programming and Scripting

Expect script error : send: spawn id exp4 not open

Hi, I am executing a expect script in while loop for doing telnet on list of servers stored in file as below : expect script : #!/usr/bin/expect -f set timeout 20 set ip set port if { == 0} { send_user "Usage: scriptname ip port\n" exit 1 } #exp_internal 1 log_user 0 spawn... (3 Replies)
Discussion started by: omkar.jadhav
3 Replies

10. Shell Programming and Scripting

Expect: spawn id exp5 not open while executing "expect "$" { send "sudo su -\r" }"

Hi All, i am trying to ssh to a remote machine and execute certain command to remote machine through script. i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as expect: spawn id exp5 not open while executing "expect "$" {... (3 Replies)
Discussion started by: Siddharth shivh
3 Replies
POSIX_SPAWNATTR_GETSCHEDPOLICY(3)			   BSD Library Functions Manual 			 POSIX_SPAWNATTR_GETSCHEDPOLICY(3)

NAME
posix_spawnattr_getschedpolicy, posix_spawnattr_setschedpolicy -- get and set the spawn-schedpolicy attribute of a spawn attributes object LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <spawn.h> int posix_spawnattr_getschedpolicy(const posix_spawnattr_t *restrict attr, int *restrict schedpolicy); int posix_spawnattr_setschedpolicy(posix_spawnattr_t *attr, int schedpolicy); DESCRIPTION
The posix_spawnattr_getschedpolicy() function obtains the value of the spawn-schedpolicy attribute from the attributes object referenced by attr. The posix_spawnattr_setschedpolicy() function sets the spawn-schedpolicy attribute in an initialized attributes object referenced by attr. The spawn-schedpolicy attribute represents the scheduling policy to be assigned to the new process image in a spawn operation (if POSIX_SPAWN_SETSCHEDULER is set in the spawn-flags attribute). The default value of this attribute is unspecified. RETURN VALUES
The posix_spawnattr_getschedpolicy() and posix_spawnattr_setschedpolicy() functions return zero. SEE ALSO
posix_spawn(3), posix_spawnattr_destroy(3), posix_spawnattr_getschedparam(3), posix_spawnattr_init(3), posix_spawnattr_setschedparam(3), posix_spawnp(3) STANDARDS
The posix_spawnattr_getschedpolicy() and posix_spawnattr_setschedpolicy() functions conform to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
The posix_spawnattr_getschedpolicy() and posix_spawnattr_setschedpolicy() functions first appeared in FreeBSD 8.0. AUTHORS
Ed Schouten <ed@FreeBSD.org> BSD
March 24, 2008 BSD
All times are GMT -4. The time now is 10:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy