The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
File transfer to a pipe val0822 Shell Programming and Scripting 1 08-18-2008 11:49 AM
Transfer the file manas_ranjan UNIX for Dummies Questions & Answers 2 07-27-2007 09:33 AM
file transfer bkan77 Shell Programming and Scripting 4 07-27-2007 05:55 AM
transfer of specific file content to another file mem101 Shell Programming and Scripting 1 10-18-2005 02:01 PM
Directory file transfer...help ian UNIX for Dummies Questions & Answers 2 07-25-2001 08:12 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-13-2008
sudhi sudhi is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 2
file transfer using Ftp

Hi All,

I am very new to shell scripting,I have some doubts how we can do a file transfer using ftp

I wanted to transfer files using non_secure ftp and secure ftp(sftp) mode,
for secure ftp i am using following code

Code:
verbose="verbose" 
ftp="/usr/bin/ftp" 
user="ABC"
pass="123"
IP="XXX.XXX.4.190" 
echo "open $IP 
      quote USER $user 
      quote PASS $pass 
      $verbose 
      $type 
      put $inputfilepath  $outputfilepath 
      close 
      quit" |$ftp -n
All variables are hard coded in th begining,How do i can find out IP addrss,username,password and assign those to below mentioned variables $IP ,$user ,$pass dynamically by creting a temp file contains all these information

and how i can perform non-secure FTP Please help me

Thanks in advance

Last edited by Yogesh Sawant; 05-13-2008 at 09:17 AM.. Reason: added code tags
  #2 (permalink)  
Old 05-25-2008
scarfake scarfake is offline
Registered User
  
 

Join Date: May 2008
Posts: 43
your "tmpfile" that contains the server/userdata
Code:
user="ABC"
pass="123"
IP="XXX.XXX.4.190"
your ftp-script,
call it like this:
ftpscript /path/to/the/userdata-tmpfile
Code:
$1
verbose="verbose" 
ftp="/usr/bin/ftp" 
echo "open $IP 
      quote USER $user 
      quote PASS $pass 
      $verbose 
      $type 
      put $inputfilepath  $outputfilepath 
      close 
      quit" |$ftp -n
should work
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




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


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0