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
Shell Script to ftp from windows server shilpa.rajput Shell Programming and Scripting 8 11-07-2007 12:52 AM
FTP Unix Box to Windows Shell Script Jose Miguel Shell Programming and Scripting 2 07-11-2007 02:30 PM
shell script to transfer files from Unix to Windows knag Shell Programming and Scripting 15 12-05-2006 05:46 PM
Shell to FTP file from Windows to unix sandeep.kamble Shell Programming and Scripting 3 09-19-2006 10:34 AM
How to execute a shell script from Windows kyawlin UNIX for Dummies Questions & Answers 4 12-19-2003 09:54 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-11-2008
ali560045's Avatar
ali560045 ali560045 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 328
FTP from unix shell script to windows

Hi,

I m trying to connect/establish FTP from unix shell script to my PC.Below the script i have written

Code:
#!/bin/ksh

ftp -v -n ddcappip01.com << "EOF"
user Amit jason
bye
EOF
------------------------------ERROR--------------------------

but i m getting the below error for the above script:

ftp : Unknown host ddcappip01.com
Not connected.

------------------------------------------------------------------------
Another try i gave but this time its getting hanged in command prompt:

Code:
#!/bin/ksh

REMOTESERVER=10.99.199.80
LOGIN='Amit'
PASSWORD='jason'
ftp -n $REMOTESERVER << INPUT_END

quote USER $LOGIN

quote PASS $PASSWORD
pwd
bye

INPUT_END
How to do FTP from unix to my PC?
Also how to get the name of my PC?
And how to use ip address of my pc instead of name in my script ?

Last edited by ali560045; 12-11-2008 at 08:03 AM..
  #2 (permalink)  
Old 12-11-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,262
So far you did nothing wrong. ftp is ftp no matter if you do it from unix to unix or unix to windows etc. Basically it is a somewhat unified File Transfer Protocol, no matter which platform it is running on.

Your problem is here:

Quote:
ftp : Unknown host ddcappip01.com
At first make sure you can reach that host from your box or else everything following will fail of course.
  #3 (permalink)  
Old 12-11-2008
ali560045's Avatar
ali560045 ali560045 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 328
Also when i m using the PC ip address then also i m not able to connect, but from my PC command prompt i m able to connect to my unix server.

How to achieve this using in k-shell script ..........Above i have written the code using IP address
  #4 (permalink)  
Old 12-11-2008
manikantants manikantants is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 131
FTP service should be enabled in the destination machine.
In you case you are trying to FTP from Unix to windows. So FTP should be enabled in your windows machine.
  #5 (permalink)  
Old 12-11-2008
ali560045's Avatar
ali560045 ali560045 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 328
I m able to do FTP from my PC to UNIX


Thanks in advance..........

Below are the steps to set up FTP Service in Desired PC:
Code:

How do I set up Windows 2000 or XP Professional to accept FTP transfers?

Installing IIS
For Windows XP Professional systems running in the default Start menu configuration, click Start, then Control Panel, then Add or Remove Programs. In Windows 2000 (or in XP if it is set to classic Start menu view), click Start, then Settings, then Control Panel, and then double-click Add/Remove Programs.


Click Add/Remove Windows Components.


Double-click Internet Information Services. This will open another window listing the IIS subcomponents.


Check File Transfer Protocol (FTP) Server. The Common Files and Internet Information Services Snap-In boxes will also check by default. Make sure no other boxes are checked, and then click OK. 
Note: Windows may prompt you for your Windows CD at this point.

Configuring the FTP server
On the desktop or Start menu, double-click or click My Computer, and then double-click the hard drive on which you have Windows installed. 


Open the folder inetpub. Right-click the ftproot folder and select Properties.


Click the Sharing tab. Select the radio button Share this folder and click Permissions. From the list that appears, select Everyone, and then click Remove. 


Click the Add... button. In the drop-down list, select your computer's name. In the list of user groups that appears in the center scrollbox, select Users. Click Add, then OK. In the Permissions window, set the access level. If a user needs only to download files from your computer, set the access to Read. To give upload permission, also check Change. Click OK.


Create user accounts for each of the individuals who will need to access your server. You can do so by opening the Control Panel and then double-clicking the Users and Passwords icon. For each user, you will need to provide a username and domain. At IU, use the Network ID username, and enter ADS for the domain. 


In the main Control Panel window, double-click Administrative Tools, and then double-click the Computer Management icon. A new window will open. On the left, beside Services and Applications, click the + (plus sign), and then click the + (plus sign) beside Internet Information Services. 


Right-click Default FTP server and select Properties. Under "Services", make sure that Allow anonymous connections is not checked. This will prevent unauthorized access to your workstation. Click OK, and then close all windows. 
Your computer should be ready to accept FTP connections.

Last edited by ali560045; 12-11-2008 at 08:37 AM..
Closed Thread

Bookmarks

Tags
shell script, shell scripting, unix download, unix scripting, unix scripting basics

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 03:50 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