10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
Hello,
I am trying to login to multiple servers and i have to run multiple loops to gather some details..Could you please help me out.
I am specifically facing issues while running for loops.
I have to run multiple for loops in else condition. but the below code is giving errors in for... (2 Replies)
Discussion started by: mohit_vardhani
2 Replies
3. Shell Programming and Scripting
All,
I have set up ssh trust between 3 machines. The aim is to connect from machine-A to B and C and clear the txt files in tmp on all 3 machines. And, I have 3 environments and each environment has 2 hosts. So I should be able to run this script on any environment.
Here is the logic:
I want... (5 Replies)
Discussion started by: pnara2
5 Replies
4. Shell Programming and Scripting
Hi I have the following Korn script having multiple for loops.
#!/bin/ksh
EXPECT=/usr/local/bin/expect
exp_internal
for d in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 i22 23 24 25 26; do
for i in 01 02 03 04 05 06 07 ; do
for h in 00 01 02 03 04 05 06 07 08 09 10 11 12... (2 Replies)
Discussion started by: cic
2 Replies
5. Shell Programming and Scripting
I am needing to include some if statements within an expect script. These will need to have two conditions under an AND join. Upon a successful IF condition I want to set multiple variables.
I have tried a lot of variations of the below statement with no success. I have also searched the WEB... (2 Replies)
Discussion started by: Slagathor
2 Replies
6. UNIX for Dummies Questions & Answers
Guru,
I try to make a loop of 2 files,
Input
File1.txt:
1
2
File2.txt:
A
B
C
A, B and C is a file name, inside A
X
Y
Z
Expected Output
A.1
X (2 Replies)
Discussion started by: guns
2 Replies
7. Shell Programming and Scripting
Hi Guys-
I'm trying to write a script which takes date as input (mm.yy.dd) and search in the current file. If pattern doesn't exist it will then look in a backup directory and so on.
being a newb i'm unable to loop over to the backup directory. hoping for some ideas, i've highlighted the... (1 Reply)
Discussion started by: Irishboy24
1 Replies
8. Shell Programming and Scripting
Hi
First of all I tried lot of forums to create my first expect script. But I am totally stumped at the last step. I am no Linux Admin or ever trained in Linux. I just tried to create the script logically
History :
I need to to change my password across lot of servers in Linux over ssh
... (4 Replies)
Discussion started by: radioactive9
4 Replies
9. Shell Programming and Scripting
I've been reading the O'Reilley expect book and I'm trying to create partial automation for common questions asked on screen in a telnet session and return to interact so the user can resume control.
For example
while {1} {
expect {
-re "What color is the sky?" {send... (0 Replies)
Discussion started by: mlarivie
0 Replies
10. Shell Programming and Scripting
Hi script gurus.
I have need to know how to use for loop with multiple variable.
Basically lets take for example /etc/passwd file has following entries
The above cat command will basically first greps the real users that have email addresses then converts ':' to '+' then using cut... (4 Replies)
Discussion started by: sparcguy
4 Replies