Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: single line reply



Writing scripts that fully interact with a program not designed to be scripted (like ftp) presents special problems, as you have found out. A couple suggestions:

1) Look in to the scripting language called "Expect", based on the tcl scripting language. It is designed specifically for doing these types of jobs.
http://expect.nist.gov/
I have never tried installing this on OS X, so YMMV.

2) Look for alternative programs to drive with your scripts. For example, if you are just trying to retrieve a file via ftp, look at scripting the "curl" program instead of the "ftp" program.

-Rajpaul

On Monday, April 29, 2002, at 09:24 AM, Michael Johnson wrote:

I'm trying to get some ideas down for shell scripting, but I don't know enough to make one thing work. Using something like passwd for example, when you tell it you want to change a password and type:

passwd username

the system brings up a prompt asking for the new password. Then, it wants to confirm it (logical choice).

Or using ftp and an example...

ftp ftp.domain.tld

the application will ask for a login and then after that's entered, ask for a password.

If I wanted to script something to automatically log in to an ftp server and upload a file, how would I do it with a single command string on one line?

-Michael
_______________________________________________
macos-x-server mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macos-x-server
Do not post admin requests to the list. They will be ignored.
_______________________________________________
macos-x-server mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macos-x-server
Do not post admin requests to the list. They will be ignored.

References: 
 >single line reply (From: Michael Johnson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.