Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Operating System
FTP Shell Script Q.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ukchucktown" data-source="post: 1122036" data-attributes="member: 129039"><p>You are misunderstanding how shell scripting works. It's doing exactly what you are telling it to do. FTP reads its commands from standard input. Your script is not the standard input of the FTP command. After you execute the ftp line in your script you will get an FTP prompt and once you type exit the next two lines in your script execute. The cd is a relative path so the operating system will look for that path relative to your current directory. The last line will generate a command not found. You need to redirect the standard input of the FTP command. I included a link. Read through the thread. It might help you understand. You need to understand file descriptors, standard input and output and how to redirect them.</p><p></p><p><a href="http://www.unix.com/ip-networking/1935-automated-ftp-task.html" target="_blank">Automated FTP task - The UNIX and Linux Forums</a></p></blockquote><p></p>
[QUOTE="ukchucktown, post: 1122036, member: 129039"] You are misunderstanding how shell scripting works. It's doing exactly what you are telling it to do. FTP reads its commands from standard input. Your script is not the standard input of the FTP command. After you execute the ftp line in your script you will get an FTP prompt and once you type exit the next two lines in your script execute. The cd is a relative path so the operating system will look for that path relative to your current directory. The last line will generate a command not found. You need to redirect the standard input of the FTP command. I included a link. Read through the thread. It might help you understand. You need to understand file descriptors, standard input and output and how to redirect them. [url=http://www.unix.com/ip-networking/1935-automated-ftp-task.html]Automated FTP task - The UNIX and Linux Forums[/url] [/QUOTE]
Verification
Post reply
Forums
Apple Computing Products:
macOS - Operating System
FTP Shell Script Q.
Top