scp script not working | Unix Linux Forums | Shell Programming and Scripting

  Go Back    

Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

scp script not working

Shell Programming and Scripting

Closed Thread    
Thread Tools Search this Thread Display Modes
Old 03-22-2013
scriptscript scriptscript is offline
Registered User
Join Date: Jan 2013
Last Activity: 16 November 2014, 9:00 AM EST
Posts: 75
Thanks: 21
Thanked 0 Times in 0 Posts
RedHat scp script not working

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

        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: line 2: spawn: command not found
couldn't read file "{": no such file or directory line 5: password:: command not found line 5: exp_continue}: command not found line 6: syntax error near unexpected token `}' line 6: `

Also I dont know what the "expect" and spawn means ?

Could anyone please help me out ?

Sponsored Links
Old 03-22-2013
vbe's Avatar
vbe vbe is offline Forum Staff  
Join Date: Sep 2005
Last Activity: 3 March 2015, 3:15 AM EST
Location: Switzerland - GE
Posts: 6,014
Thanks: 182
Thanked 451 Times in 422 Posts
Next time open your own thread, Hijacking wont be tolerated...
(Moved to new thread...)
Sponsored Links
Old 03-22-2013
PikK45 PikK45 is offline
Registered User
Join Date: Jul 2012
Last Activity: 26 November 2014, 5:10 AM EST
Location: Chennai
Posts: 567
Thanks: 43
Thanked 74 Times in 72 Posts
Try this in your system which expect .
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 09:54 AM
scp not working because of prompt (AIX, tcsh) lastZenMaster UNIX for Dummies Questions & Answers 1 07-24-2011 09:59 AM
ssh and scp not working jegaraman Solaris 4 01-06-2011 06:34 AM
scp not working while ssh works bakunin AIX 4 05-13-2010 03:19 AM
scp is not working through sh script Amit.Sagpariya Shell Programming and Scripting 8 03-10-2010 07:34 AM

All times are GMT -4. The time now is 04:53 AM.