LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-18-2006, 05:35 PM   #1
closet geek
Member
 
Registered: Apr 2003
Location: England
Posts: 146

Rep: Reputation: 15
ftp'ing via shell script issue


Hi,

Why does this code:

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
cd public_html
put $FILE
quit
END_SCRIPT
exit 0

end up placing the file above the public_html direcory? It definitely changed to public_html (as confirmed by pwd). Yet it *always* puts the file above the public_html.

Help!

cg

p.s. is it sad I just tried to dd a line in this box
 
Old 09-19-2006, 10:54 AM   #2
closet geek
Member
 
Registered: Apr 2003
Location: England
Posts: 146

Original Poster
Rep: Reputation: 15
Got everyone beat eh?

cg
 
Old 09-19-2006, 12:01 PM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,809

Rep: Reputation: 2098Reputation: 2098Reputation: 2098Reputation: 2098Reputation: 2098Reputation: 2098Reputation: 2098Reputation: 2098Reputation: 2098Reputation: 2098Reputation: 2098
Is it possible that the server only allows uploads to the public_html directory?
 
Old 09-19-2006, 05:08 PM   #4
closet geek
Member
 
Registered: Apr 2003
Location: England
Posts: 146

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ntubski
Is it possible that the server only allows uploads to the public_html directory?
That'd be perfect, but the upload is going above the public_html directory even though a pwd shows that the public_html is the currently selected directory!

Just to make it clear, the upload goes into /home/user/ when I want it to go to /home/user/public_html/

cg
 
Old 09-20-2006, 02:05 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,415

Rep: Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785
I think ntubski meant the dir above that eg is it possible that write perm is not avail on the public_html dir to the ftp process.
Just because you can cd into it, doesn't mean you can write to it.
 
Old 09-20-2006, 05:44 AM   #6
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,516

Rep: Reputation: 239Reputation: 239Reputation: 239
what if you do it manually?
does it work?

is it your machine?
 
Old 09-20-2006, 10:11 AM   #7
closet geek
Member
 
Registered: Apr 2003
Location: England
Posts: 146

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bigearsbilly
what if you do it manually?
does it work?

is it your machine?
Yes it's my machine! Anywho I have got it sorted now, it was a problem with the $FILE parameter. I'd set it to /confirm but FTP translated the / as an instruction to go to the FTP root.

Thanks,

cg
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I made a shortcut to a shell script and it is using default shell icon... shlinux Linux - Software 2 04-20-2006 07:29 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 03:34 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM
issue with shell script chupacabra Linux - General 3 10-18-2002 09:12 PM
Out of guesses! (shell Script issue) chris Linux - General 2 12-10-2001 05:20 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration