![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SFTP Failed---Request for subsystem 'sftp' failed on channel 0 | mahiban | AIX | 0 | 07-25-2008 02:51 AM |
| Amend the size of a Partition Error | drchris | SUN Solaris | 2 | 02-25-2008 06:58 AM |
| help in SFTP please help | bsandeep_80 | Shell Programming and Scripting | 3 | 08-01-2007 02:33 PM |
| sftp vs scp | Sowser | UNIX for Advanced & Expert Users | 2 | 03-21-2007 09:33 AM |
| Script to backup multiple files and amend their filenames | m223464 | Shell Programming and Scripting | 5 | 11-25-2005 06:30 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
amend ftp to sftp
Hi all, below is my current script
Code:
ftp -n << FTPCTRL open $my_ip user $my_user $my_pass ascii prompt off lcd $myDIR cd $ftp_cd $OPS $myfile FTPCTRL Code:
sftp -b $batchfile $my_user@remotehost << FTPCTRL .. .. |
|
||||
|
put all of your commands in the batch file. do not use the HERE document. you can exclude the open/user commands also. sftp is already using this on the command line. You will be prompted for the password. If this is a problem then I would suggest that you setup a ssh key. this is the best way for an automated script.
If you want to use a variable in the batch file then I would suggest generating the batch file and then call it with sftp |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|