LinuxQuestions.org
Visit Jeremy's Blog.
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, 04: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, 09: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, 11:01 AM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,399

Rep: Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814
Is it possible that the server only allows uploads to the public_html directory?
 
Old 09-19-2006, 04: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, 01:05 AM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,251

Rep: Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026
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, 04:44 AM   #6
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,284

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

is it your machine?
 
Old 09-20-2006, 09: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 06:29 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 02:34 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
issue with shell script chupacabra Linux - General 3 10-18-2002 08:12 PM
Out of guesses! (shell Script issue) chris Linux - General 2 12-10-2001 04:20 PM


All times are GMT -5. The time now is 07:26 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration