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
Can we use aliased commands in script? Chanakya.m Shell Programming and Scripting 19 01-13-2006 02:10 PM
running commands from script owijust Shell Programming and Scripting 2 01-09-2006 06:12 PM
Repeating commands in a script Dave2874 Shell Programming and Scripting 4 03-14-2005 10:34 AM
script commands romeoz UNIX for Dummies Questions & Answers 2 06-21-2004 09:10 PM
vi Commands in a Script djschmitt Shell Programming and Scripting 7 07-10-2003 08:47 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 02-27-2002
ali.merchant ali.merchant is offline
Registered User
  
 

Join Date: Feb 2002
Location: Illinois
Posts: 3
Unhappy script for ftp commands

Hi
I need to setup a script to ftp a file from one unix box to another. I have modified the.netrc file, thus I can ftp into another box without being prompted for password. The question I have is, how can I setup a script which would after ftp, will change a directory, issue the bin command, then issue the put command and then quit the ftp. Could anyone help?????
Thanks
  #2 (permalink)  
Old 02-27-2002
ali.merchant ali.merchant is offline
Registered User
  
 

Join Date: Feb 2002
Location: Illinois
Posts: 3
Cool Answer

Following is the script code that I got from a friend and it worked like a charm:

/usr/bin/ftp ftpsiteaddress <<EOI
verbose on
bin
cd <directoryname>
put <filename>
quit
EOI

Ali
  #3 (permalink)  
Old 02-27-2002
Cameron's Avatar
Cameron Cameron is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 499
You might also need to include a user name and password also.

/usr/bin/ftp ftpsiteaddress <<END
verbose on
bin
user username password
cd <directoryname>
put <filename>
mput <filename>
get <filename>
mget <filename>
bye
END


Also when you copy the above, ensure that there are no white-spaces after the END, otherwise you'll have errors.
  #4 (permalink)  
Old 02-28-2002
ali.merchant ali.merchant is offline
Registered User
  
 

Join Date: Feb 2002
Location: Illinois
Posts: 3
Thumbs up Thanks

Thanks for your help.
Ali
  #5 (permalink)  
Old 03-11-2002
Bashar Bashar is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 66
using the username and password in your script file will send them as clear text if security is an issue better to use them in .netrc for security issues
  #6 (permalink)  
Old 03-11-2002
Cameron's Avatar
Cameron Cameron is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 499
Agreed, however if the ftp is within the same subnet, or does not go outside the primpary firewall ( or DMZ ), you should not really have any troubles.

Hope I got that right, still learning the networking side of things.
  #7 (permalink)  
Old 09-05-2002
sierra_aar sierra_aar is offline
Registered User
  
 

Join Date: Feb 2002
Location: Small country named: Israel
Posts: 24
Thumbs up

Cameron

T H A N K S !!!

Your script is magic !!! :-)
Closed Thread

Bookmarks

Tags
automated login, ftp

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 02:15 PM.


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