Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 09-16-2002, 04:55 AM   #1 (permalink)
Hrqls
Regular Contributor
 
Join Date: May 2002
Location: Alkmaar, the Netherlands
Posts: 167
Hrqls is on a distinguished road
shell script for ftp

hi,

we are converting our own software from windows to linux and i need some shell script

the shell script needs to ftp to a specific ip and to a specific username on that address (but no password is needed)

it needs to download a specific file (from the path /var/kwc)

does anyone have any clue how to do this ?
__________________
The specialty of the house? thats me (cheap as always)
Hrqls is offline   Reply With Quote
Old 09-16-2002, 07:08 AM   #2 (permalink)
Hrqls
Regular Contributor
 
Join Date: May 2002
Location: Alkmaar, the Netherlands
Posts: 167
Hrqls is on a distinguished road
lemme rephrase that

how can i submit the username on the commandline of the ftp command ?

(when i manually ftp to the ip .. then i have to enter a username .. and i would be logged in .. it wont ask for a password)

(the system is running on redhat 7.3)
__________________
The specialty of the house? thats me (cheap as always)
Hrqls is offline   Reply With Quote
Old 09-16-2002, 09:42 AM   #3 (permalink)
sdeming
Code Monkey
 
Join Date: Jul 2002
Location: Michigan
Posts: 85
sdeming is on a distinguished road
This sytanx is usually acceptible:[SHELL]ftp://user@host/path/to/file[/SHELL]Alternatively, you may want to look at wget.
__________________
Scott
B4 09 BA 09 01 CD 21 CD 20 53 63 6F 74 74 24
sdeming is offline   Reply With Quote
Old 09-16-2002, 01:46 PM   #4 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
Code:
ftp abc:123@thehost.org 21
that is the syntax , and if it isn't, which I am sure it is, type "ftp --help" or something like that.
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 09-16-2002, 11:58 PM   #5 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,694
redhead is on a distinguished road
Or if it's ncftp thats beeing used:
# ncftpput -u user host.domain /the/file

-- Edit --
Oops just read the post, it needs to fetch a file..
Then:
# ncftpget -u user host.domain /put/it/here /file/to/get
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 09-17-2002, 01:49 AM   #6 (permalink)
Hrqls
Regular Contributor
 
Join Date: May 2002
Location: Alkmaar, the Netherlands
Posts: 167
Hrqls is on a distinguished road
ah thanks .. i didnt know you could just leave the password out of it, i thought you were forced to give one that way
__________________
The specialty of the house? thats me (cheap as always)
Hrqls is offline   Reply With Quote
Old 09-19-2002, 01:26 PM   #7 (permalink)
kenshi
Registered User
 
kenshi's Avatar
 
Join Date: Jun 2002
Location: Antarctica
Posts: 43
kenshi is on a distinguished road
Send a message via ICQ to kenshi
If you need to pass the commands automatically, you can do that by piping them. For instance, you could do something like this:

echo "cd directory\nget blah.txt\nquit" | ftp user@ftp.blah.com

This method is dependant on everything going as it should though and I wouldn't recommend it if you can just do it interactively. And don't forget the quit command. The program will just stay open if you don't.
kenshi is offline   Reply With Quote
Old 09-20-2002, 03:14 AM   #8 (permalink)
Hrqls
Regular Contributor
 
Join Date: May 2002
Location: Alkmaar, the Netherlands
Posts: 167
Hrqls is on a distinguished road
hm nice .. i forgot the "echo" .. i tried both | and > and < but i didnt succeed .. so i thought it was not possible that way

thanks
__________________
The specialty of the house? thats me (cheap as always)
Hrqls is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
running a script at designated time tzarin PHP 5 05-12-2004 07:11 PM
Shell inside webbrowser Hrqls Linux / BSD / OS X 5 04-14-2004 06:41 AM
CLI for noobies: shell programming sde Code Newbie News 0 03-15-2004 12:33 PM
JS Script question M3GAPL3X HTML, XML, Javascript, AJAX 5 04-20-2003 09:21 PM


All times are GMT -8. The time now is 02:42 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting