|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all, I am in the process of writing shell script to copy the files from one server to another. Manually I have successfully copied the files from other server. Now I am in the process of writing shell script for the same. While browsing I had found the below script Code:
#!/usr/bin/expect
spawn scp user@xx.x.x.x:/exceptions.csv destinationpath
set pass "newpass"
expect {
password: {send "$pass\r"; exp_continue}
}But on the execution of the below code I got the below errors Code:
scptest.sh: line 2: spawn: command not found
couldn't read file "{": no such file or directory
scptest.sh: line 5: password:: command not found
scptest.sh: line 5: exp_continue}: command not found
scptest.sh: line 6: syntax error near unexpected token `}'
scptest.sh: line 6: `Also I dont know what the "expect" and spawn means ? Could anyone please help me out ? Regards, J |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Next time open your own thread, Hijacking wont be tolerated...
(Moved to new thread...) |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Try this in your system
which expect .
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SCP not working while SSH works | posix | Solaris | 5 | 12-23-2011 08:54 AM |
| scp not working because of prompt (AIX, tcsh) | lastZenMaster | UNIX for Dummies Questions & Answers | 1 | 07-24-2011 08:59 AM |
| ssh and scp not working | jegaraman | Solaris | 4 | 01-06-2011 05:34 AM |
| scp not working while ssh works | bakunin | AIX | 4 | 05-13-2010 02:19 AM |
| scp is not working through sh script | Amit.Sagpariya | Shell Programming and Scripting | 8 | 03-10-2010 06:34 AM |
|
|