Sponsored Content
Top Forums UNIX for Beginners Questions & Answers To send ID and Password for each command using expect feature in bash script Post 303036013 by Xtreme on Wednesday 12th of June 2019 11:45:53 AM
Old 06-12-2019
Its an application based command which shows the routing table just as below. After each such get command it asks for the user id and password. Problem with my script is that it is successfully taking id password for 101 and displaying the routing table but after that it executes the get command for 102 but doesn't takes id and password and stuck at the user name prompt.

Code:
cmcli get 101
cmcli get 102
cmcli get 103

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Use Send command of Expect package

HI All, I am currently working on one command line application on AIX (Unix Platform).Here i need to use Expect package. By using Expect package at the top of the script,i want to use just Send command of Expect package to send characters like, 1. Press Enter key 2. Press spacebar 3.... (6 Replies)
Discussion started by: neha123
6 Replies

2. Shell Programming and Scripting

Is there a way to ask expect wait for sometime before running the next send command ?

Hi all, After expect catches the string I specify, is there a way to ask expect wait for sometime before running the next send command ? So my script looks like following, expect "some string" #How to ask expect to wait for a while send "next command" The reason I want to do this is... (0 Replies)
Discussion started by: qiulang
0 Replies

3. Shell Programming and Scripting

within shell script send expect and if else

Hi I have written one shell script , using that i am able to connect to remote machine but i have to #!/usr/bin/expect -f set address set username set password set OOLpath set dbusername set dbpasswd set tnsname set recdbusername set recdbpasswd set rectnsname spawn ssh... (1 Reply)
Discussion started by: mnmonu
1 Replies

4. Shell Programming and Scripting

Command substitution in send/expect. Please help!

Hi, the following code is not working. How can I cat the last modified file in the path /asdf. Please help! expect "asdf%" {send "cat `ls -rt /asdf|tail -1` \r"} (2 Replies)
Discussion started by: thulasidharan2k
2 Replies

5. AIX

Send ctrl+C in expect script

Hi, Am trying to transfer file via FTP using expect script from server to client i need to interrupt the file transfer between server and client Please help what should used in expect code.. I used send "ctrl+c\r" expect "Aborted" but that didnt work.. I need what should... (3 Replies)
Discussion started by: Priya Amaresh
3 Replies

6. Shell Programming and Scripting

Make a password protected bash script resist/refuse “bash -x” when the password is given

I want to give my long scripts to customer. The customer must not be able to read the scripts even if he has the password. The following command locks and unlocks the script but the set +x is simply ignored. The code: read -p 'Script: ' S && C=$S.crypt H='eval "$((dd if=$0 bs=1 skip=//|gpg... (7 Replies)
Discussion started by: frad
7 Replies

7. Shell Programming and Scripting

Bash Script: Send files to SFTP using Expect

I have to send few gzipped files from local server to SFTP server. My Server Info Distributor ID: Ubuntu Description: Ubuntu 12.04.4 LTS Release: 12.04 Codename: precise Created a bash script and could able to send files to sftp, but i want to send email if transfer is successful. ... (1 Reply)
Discussion started by: krux_rap
1 Replies

8. Shell Programming and Scripting

How to use expect and send command in UNIX/Linux?

Hello Everyone, I am executing a unix script which logs into 50+ servers (netapp servers) and runs some commands and captures output locally. Below is the code snippet. file1.txt has names of all the remote servers where I am logging in. #!/bin/ksh #!/usr/bin/expect touch... (1 Reply)
Discussion started by: rahul2662
1 Replies

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

10. Shell Programming and Scripting

Expect command to send the user input enter or ctrl+c

Hey All, I am writing one script using expect, that script which is used in spawn will accepts only 1. Enter 2. Ctrl+c Press Control-C to exit, Enter to proceed. Could some one share some thoughts to send the above user inputs in linux expect block ? Thanks, Sam (0 Replies)
Discussion started by: SCHITIMA
0 Replies
yppasswd(1)						      General Commands Manual						       yppasswd(1)

NAME
yppasswd - change password in Network Information Service (NIS) SYNOPSIS
yppasswd [name] DESCRIPTION
Note If Enhanced Security is enabled on your system, use the passwd command to change your password, even if NIS is in use. The yppasswd command lets you change your password in the Network Information Service (NIS) map, a network data base service. Only you or the superuser can change your NIS password. When you enter the yppasswd command, the program prompts you for the old password and then for the new password. Note that the passwords are not displayed on the screen. Next, the program asks you for the new password again, to verify that you have typed it correctly. If you do not type the passwords cor- rectly, you will receive an error message after you enter the new password. Your new NIS password must meet one of the following requirements: It must be a combination of at least six alphanumeric characters, or It must be a minimum of four characters, with at least one being non-alphanumeric, such as a control sequence. Note The passwd command does not change the NIS password. This command only changes the local password file (/etc/passwd), and not the NIS mas- ter password file. ERRORS
Your new password does not meet the minimum length requirement. You misspelled your new password or its verification. Your new password can not be activated. It must be different from your old password and your login name. FILES
Password file NIS directory SEE ALSO
passwd(1), passwd(4), ypfiles(4), yppasswdd(8) Network Administration yppasswd(1)
All times are GMT -4. The time now is 04:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy