Sponsored Content
Full Discussion: send: spawn id exp3 not open
Operating Systems AIX send: spawn id exp3 not open Post 302355313 by groosha on Tuesday 22nd of September 2009 09:57:12 AM
Old 09-22-2009
Yes it does uses expect. Here is script which gives error. Thanks for looking at this.

#!/bin/ksh

#Set Oracle Home Directory
OHD=/xxx
#Change Directory
cd /xx/yyy
#Define Script Return Code
integer RC=0
export oldpass=`cat ${OHD}/.oracle.pw`
export newpass=`cat ${OHD}/.oracle_new.pw`

/site/bin/expect <<EOF

spawn passwd oracle

expect "oracle's Old password:"
send "$oldpass\r"
expect "oracle's New password:"
send "$newpass\r"
expect "Enter the new password again:"
send "$newpass\r"
expect eof
EOF
#Set Return Code From passwd Script
RC=$?
exit ${RC}
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

spawn: not found

Hi, I'm very new to UNIX. I need to FTP a file to a remote host. It happens through a port 2222.I need to automate the process as the SCP command prompts for a password. 1) The regular ftp, tells me that the connection is refused 2) The sftp login@remotehost gives me... (0 Replies)
Discussion started by: sandy.cog
0 Replies

2. UNIX for Dummies Questions & Answers

Script to open program and send/execute command in program

Hi, i want to write a script that executes a program (exec?) . this program then requires a filename as input. how do i give it this input in the script so the program will be complete run and close by the script. e.g. exec prog.exe program then asks for filename "enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies

3. Shell Programming and Scripting

howto use a for(( exp1; [ test exp2 ]; exp3 )); construct

Hi, I am fairly novice at bash but not bad at C and so wondered if a for loop could be done as shown below:#!/bin/sh echo "Enter some strings , terminate with a single 'x':"; REPLY=; #I am trying to replace this with a arithmetic for statement: j=0; while ; do ((j++)); # My logic: ... (3 Replies)
Discussion started by: HowardL
3 Replies

4. Solaris

Spawn Not Found

I need to run the spawn command but when I typed it in, I got "ksh: spawn: not found". So, I downloaded spawn-fcgi but it required to be compiled first. The compile failed when I tried it. I need a copy that's ready to be used. Unix system info: OS: Sun Solaris 2.8 Shell: ksh Does... (4 Replies)
Discussion started by: april
4 Replies

5. Shell Programming and Scripting

can i send shell commands to a open window

i want to write a script that automatically fills in a form and pushes a few buttons. can i do that with bash or something similar? (1 Reply)
Discussion started by: magiling
1 Replies

6. UNIX for Advanced & Expert Users

spawn() Vs. fork()

what is diffenrence between spawn and fork ? "fork() system call spawns the processess" what is mean by this sentence. (1 Reply)
Discussion started by: anandgodse
1 Replies

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

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

9. Shell Programming and Scripting

Couldn't read packet: Connection reset by peer send: spawn id exp4 not open while executing

Hi All, I am having an issue with my script which I am using to get files from a remote server. In my script I am going to server:- REMOTESERVER and directory:- /Interface/Upload, and then getting files from there to my local server directory:- /ftp/jail_nextview_LMS/home/nextview_LMS/outbox. ... (1 Reply)
Discussion started by: Hero6438
1 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 05:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy