Sponsored Content
Top Forums Shell Programming and Scripting expect script inside shell script not working. Post 302719115 by bhavesh.sapra on Monday 22nd of October 2012 05:58:52 AM
Old 10-22-2012
expect script inside shell script not working.

Shell Scipt: temp.sh
Code:
su - <$username>
expect pass.exp

Expect script: pass.exp
Code:
#!/usr/bin/expect -f
# Login 
#######################
expect "Password: " send "<$password>\r"

it comes up with Password: but doesnt take password passed throguh file.

Last edited by Franklin52; 10-23-2012 at 04:47 AM.. Reason: Code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to run shell script inside expect script?

I have the code like this : shell script continues ... .... expect -c" spawn telnet $ip expect "login:" send \"$usrname\r\" expect "Password:" send \"$passwd\r\" expect "*\>" send \"$cmdstr\r\" ... (1 Reply)
Discussion started by: robbiezr
1 Replies

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

3. Shell Programming and Scripting

Can i use if else inside expect command in shell script?

hii,, I am trying to automate jira. during my scripting using bash script, in the terminal i got the terminal message like this: "Configure which ports JIRA will use. JIRA requires two TCP ports that are not being used by any other applications on this machine. The HTTP port is where you... (1 Reply)
Discussion started by: nithinfluent
1 Replies

4. Shell Programming and Scripting

Passing username and password to a script running inside "expect" script

Hi I'm trying to run a script " abc.sh" which triggers "use.sh" . abc.sh is nothing but a "expect" script which provides username and password automatically to the use.sh script. Please find below the scripts: #abc.sh #!/usr/bin/expect -f exec /root/use.sh expect "*name*" send... (1 Reply)
Discussion started by: baddykam
1 Replies

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

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

7. Shell Programming and Scripting

Expect not working inside my Bash script

I am trying to execute expect command inside by small bash script to login into servers using key authentication method. My script is as follows: #!/bin/bash HOST=$1 /usr/bin/expect -c " spawn ssh -i /root/.ssh/id_rsa root@$HOST expect -exact "Enter... (3 Replies)
Discussion started by: John Wilson
3 Replies

8. Shell Programming and Scripting

How to merge Expect script inside shell script?

Hi I have two scripts one is Expect and other is shell. I want to merge Expect code in to Shell script so that i can run it using only one script. Can somebody help me out ? Order to execute: Run Expect_install.sh first and then when installation completes run runTests.sh shell script. ... (1 Reply)
Discussion started by: ashish_neekhra
1 Replies

9. Shell Programming and Scripting

Aliases NOT working inside bash shell script

i have defined a function ln_s() for customizing the ln command in script1.sh. more script1.sh echo "Starting Execution" ./script2.sh echo "End of Execution" ln_s(){ ] && return ln -s "$1" "$2" } My script1.sh executes another script2.sh which has the following entry more script2.sh... (12 Replies)
Discussion started by: mohtashims
12 Replies

10. Shell Programming and Scripting

Multiple expect/send statements not working in shell script

Hi I am trying the following in my bash script which logs into my machine and runs a command. Trying to solve this using expect. The first expect statement is hit and it enters the address "10.10.0.10" but when the second expect statement is hit it exits #!/bin/bash expect -c ' spawn... (2 Replies)
Discussion started by: skorada
2 Replies
auth(5) 							File Formats Manual							   auth(5)

Name
       auth - auth database

Description
       The  database is a repository of security-relevant information about each user of the system. This database contains the encrypted password
       associated with the user's account in addition to a list of assorted capabilities.  The database is stored as an database in the files  and
       Records are retrieved with the library routine.	Access to the database is restricted to the superuser and members of the group

       Auth records may be converted to an ASCII representation whose format is:
       1000:4KvidFYwovnwp3j8lll78dC1:1920129:3600:2678400:03:0:1000:0:00:00
       The first field is the UID of the entry that is used as the key into the database. Then follows:

       Encrypted Password
		      This  is the user's encrypted password. Whether this password or the one from the file is actually used is determined by the
		      security level that the system is running at.

       Password Modification Time
		      This is the time(2) the password was last set.

       Minimum Password Lifetime
		      This is the minimum number of seconds which must elapse between setting passwords.

       Maximum Password Lifetime
		      This is the maximum period of time for which the password will be valid.

       Account Mask   These are capabilities pertaining to the account itself.	They are:

			 1 A_ENABLE: this account is enabled.
			 2 A_CHANGE_PASSWORD: The user can change his or her password.
			 4 A_ENTER_PASSWORD: The user is not required to use machine-generated passwords.

       Login Failure Count
		      This is the count of unsuccessful login attempts since the last successful login.

       Audit ID       Positive integer identifier used in generating audit records for the user.

       Audit Control  See the reference page, SET_APROC_CNTL section for more information.

       Audit Mask     Determines which events will be audited for the user. See the and reference pages for more information.

Restrictions
       Only the superuser and members of the group may read information from the auth database.  Only the superuser may modify the auth database.

Files
See Also
       audcntl(2), getauthuid(3), getpwent(3), edauth(8)

																	   auth(5)
All times are GMT -4. The time now is 04:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy