10-02-2007
the response is:
spawn /bin/su
Password:
su: Sorry
send: invalid spawn id (4)
while executing
"send "/bin/echo Hello>>/tmp/readfil\n""
(file "exp" line 7)
If I didn't have a whitespace in expect "\r\n", the program ran but nothing being created in /tmp/readfil.
- Zac
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
:confused: Can anyone please tell me how to get into Interactive Mode? (2 Replies)
Discussion started by: Nomad
2 Replies
2. Shell Programming and Scripting
Hi All,
Does perl has an interactive mode like other shell?
If there is, can any one show me the equivalent code for the below csh script ? This csh code prompts user for their name and prints the name.
#!/bin/csh
echo -n "Pls enter the your name: "
set name = ($<)
echo "You hav... (2 Replies)
Discussion started by: Raynon
2 Replies
3. Solaris
Ever since I have started using Solaris 10 images, I have had a problem I can not find a solution for.
I have a Solaris 10 image that I created from a Solaris 10 DVD. The sysidcfg file has been created and set up in the bootparams file.
I have no issues in Solaris 8 or 9. In Solaris 10, the... (5 Replies)
Discussion started by: rsherry
5 Replies
4. Shell Programming and Scripting
Gud morning everybody,
I need small help form you people,Please advice me.
I have a utility(adpatch) which takes 10-15 prompts, i want to automate this by calling this utility in shell script. Now my qiestion i want to run the script in non interactive mode.
An example.
$adpatch... (1 Reply)
Discussion started by: swetham.apps
1 Replies
5. Homework & Coursework Questions
Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines.
It then prompts for deletion of the file.
If user supplies arguments with the script , then it works on those files... (8 Replies)
Discussion started by: rits
8 Replies
6. Solaris
I want zlogin -C as non interactive mode so after booting the zone I created a file sysidcfg in /etc directory
of the zone the sysidcfg file info as shown below.
system_locale=C
terminal=dtterm
network_interface=primary {
hostname=my-zone
}
security_policy=NONE... (1 Reply)
Discussion started by: vijaysachin
1 Replies
7. UNIX for Advanced & Expert Users
Hi ,
I login to unix using my id and then do a sudo to execute any programs i want.
sudo su - <id>
password : xxxxxxx
Is there a way to make it non interactive so that i can use it in shell script. (1 Reply)
Discussion started by: ashwin3086
1 Replies
8. Shell Programming and Scripting
Hi All,
I am writing a script(Auto_Installation.sh) which is calling one another script (./update_manager /spare/install/HO7/PME_Response_file.txt)
Now the issue is result of (./update_manager /spare/install/HO7/PME_Response_file.txt) script is
##########################################... (6 Replies)
Discussion started by: Dhruvak
6 Replies
9. Shell Programming and Scripting
Hi All,
I need to sftp without any intervention.(LInux,Ksh)
I have tried some ideas listed here...but its not working...
Please advise on it. (1 Reply)
Discussion started by: jesu
1 Replies
10. UNIX for Dummies Questions & Answers
Hello all,
can we SFTP to the destination server in a non-interactive mode with out estbalishing the public key of origination server in the destination server? meaning i want to harcode the password as part of the below script or as an variable?
Please let me know if there is any better way to... (2 Replies)
Discussion started by: Ariean
2 Replies
LEARN ABOUT DEBIAN
posix_spawnattr_init
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.10 30 Jan 2004 posix_spawnattr_destroy(3C)