ftp: Name or service not known | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

ftp: Name or service not known

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 05-03-2011
Naga06 Naga06 is offline
Registered User
 
Join Date: May 2011
Last Activity: 5 July 2014, 10:44 AM EDT
Location: Chennai
Posts: 49
Thanks: 11
Thanked 0 Times in 0 Posts
Hammer & Screwdriver ftp: Name or service not known

Hi All,

I'm a new user. When I try to use ftp in a script, its throwing the below error "ftp: Name or service not known".

what could be the issue??? Pls help.
Sponsored Links
    #2  
Old 05-03-2011
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 28 July 2014, 4:33 PM EDT
Location: NM
Posts: 10,156
Thanks: 269
Thanked 781 Times in 731 Posts
Please show us your script - the part with the problems.
Sponsored Links
    #3  
Old 05-03-2011
Naga06 Naga06 is offline
Registered User
 
Join Date: May 2011
Last Activity: 5 July 2014, 10:44 AM EDT
Location: Chennai
Posts: 49
Thanks: 11
Thanked 0 Times in 0 Posts
Halo jim mcnamara,

Pls find the script below.


Code:
HOST=XXXX
USER='USER'
PASSWD='PWD'
PATH=file/bak
ftp -n -i $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
cd $PATH
get file_name
bye
END_SCRIPT

Thanks in Advance....

Last edited by Franklin52; 05-04-2011 at 02:30 AM.. Reason: Please use code tags
    #4  
Old 05-03-2011
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 28 July 2014, 4:33 PM EDT
Location: NM
Posts: 10,156
Thanks: 269
Thanked 781 Times in 731 Posts
1. can you ping your remote host

Code:
# XXXX is not the real hostname
ping XXXX

2. If #1 worked can you telnet to port 21 on the remote box?

Code:
telnet XXXX 21

IF you get something like this

Code:
Trying 10.128.3.251...
Connected to 10.128.3.251.
Escape character is '^]'.

it worked. Let us know.
The Following User Says Thank You to jim mcnamara For This Useful Post:
Naga06 (05-03-2011)
Sponsored Links
    #5  
Old 05-03-2011
Naga06 Naga06 is offline
Registered User
 
Join Date: May 2011
Last Activity: 5 July 2014, 10:44 AM EDT
Location: Chennai
Posts: 49
Thanks: 11
Thanked 0 Times in 0 Posts
Thanks a lot for your quick revert.

The thing is, I'm able to ping/ ftp to HOST normally.

But inside the script, its not working.

Kindly Suggest.
Sponsored Links
    #6  
Old 05-04-2011
methyl methyl is offline Forum Advisor  
Advisor
 
Join Date: Mar 2008
Last Activity: 18 April 2014, 5:13 AM EDT
Posts: 6,396
Thanks: 287
Thanked 672 Times in 642 Posts
$PATH is a reserved variable in Shell. Use another name for the variable!

By changing the value of $PATH you have stopped your script from being able to find "ftp" ... or for that matter any program which is not in "file/bak".
Sponsored Links
    #7  
Old 05-04-2011
Naga06 Naga06 is offline
Registered User
 
Join Date: May 2011
Last Activity: 5 July 2014, 10:44 AM EDT
Location: Chennai
Posts: 49
Thanks: 11
Thanked 0 Times in 0 Posts
Dear Methyl,

I changed the variable name and even then No Go......
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT -4. The time now is 10:33 PM.