[NTLUG:Discuss] expect or what
Leroy Tennison
leroy_tennison at prodigy.net
Sun Sep 21 23:16:26 CDT 2008
Wayne Walker wrote:
> If you are only doing ftp, use ftp and .netrc. No need for expect.
>
> Is there any other reason for expect?
>
> If possible, quit using ftp, switch to rsync over ssh with public key
> authentication.
>
> I haven't needed anything but rsync, ssh, sftp for automation in years.
>
> Wayne
>
> On Fri, Sep 19, 2008 at 12:07:42PM -0500, Fred James wrote:
>> All
>> (this is only slightly off topic - it is all *nix, if not all linux)
>> I have been embedding 'expect' scripts (embedded in sh/BASH) to do
>> interactive things like ftp - great thing is that I can also get a log
>> of the process
>> expect << EOF >> $LogFile
>> (some code)
>> EOF
>> As you can see, there are really 2 parts to this: (a) get an
>> interactive job done non-interactively, and (b) log the process (3
>> actually, as I search the log info for exception/errors, and act upon
>> any found)
>>
>> Now the issue - I am getting some resistance to 'expect' (i.e., it isn't
>> on a system and I get raised eyebrows about wanting it there)
>>
>> So, I am taking a step back for a moment to ask, am I am being silly?
>> Is there another, perhaps better or at least not worse, way to
>> accomplish the requirements?
>>
>> Thank you in advance for any help you may be able to offer
>> Regards
>> Fred James
>>
>> PS: Please don't say Perl! 'expect' in shell is so much simpler.
>>
>>
>> _______________________________________________
>> http://www.ntlug.org/mailman/listinfo/discuss
>
I don't know if your concern is timing delays or not but a "here
document" might meet your needs.
More information about the Discuss
mailing list