Have an expect script but can't seem to de-bug it. It's stalling at the password prompt. If anyone can see a mistake, kindly let me know. Thanks.
Here is the error:
Here is my expect script:
I am rather new to using expect and have only written a few scripts using it. I am trying to create a script that will read a file containing a number of hostnames and then for each one: ssh into the box, run a command, scp the output back to a center server.
So far I can make all that... (2 Replies)
I am trying to write a script that telnets out to multiple ip's, runs some commands exits and the telnets to the next ip. I wrote the following script and it works great until the program hits a nonresponsive ip.
I would like this to recognize the ip is bad and move on in the foreach loop. How... (4 Replies)
I am using Expect to spawn a command that loops through a text file and runs the same command for each item in the text file.
The text file, named stat.txt looks something like this:
2007-04 alist 543
2008-07 blist 543
2008-03 xlist 345
2008-03 ylist 675
2003-03 zlist 567
The expect... (1 Reply)
Hi all,
I have got a small expect script like this one.
#!/usr/bin/expect -f
set timeout 2
spawn ftp $env(IP)
match_max 100000
expect -exact "Name"
send -- "$env(USER)\n"
expect -exact "Password:"
send -- "$env(PASSWORD)\n"
expect "%"
send "bin\r"
expect "%"
send "prompt\r"... (5 Replies)
Hi experts,
I have two question about expect script
questions 1
send "tar -xjvf a.tar\r"
send "ifconfig\r"
I want to know if it just run "ifconfig after "tar -xjvf a.tar complete. or the two cmd run at the same time
question 2
after I use the expect to ssh to the... (1 Reply)
I'm having some difficulty with convincing Expect to do what I need..
I have a loop that waits for input, a specific phrase of text followed by a single word. I need Expect to capture that word following the specific phrase. It should then store the word in a variable.
I'm fairly sure it's... (6 Replies)
Hi.,
I need to ask question for expect script.
I have prompt like #
and very long script (orachk).
I added to expect script line
set prompt "(%|#|\\\$) $"
and insert into it also piece of code
----
expect {
timeout {
puts "Running..."
exp_continue
}
... (0 Replies)
I have an expect script that appears to be working normally however for some reason, the remote side appears to be stripping off the variables from the awk command.
This is the original:
expect \"~]$\"
send \"sed 's/=/ /g;s/,/ /g' /home/file.txt | grep abc | awk '{print $6,$8}'This is the... (5 Replies)
I'm using expect to log into a remote host and then execute another script. A log of the script is being created but I can't see to get the script to display while it's running. Any ideas would be appreciated. Here is the script.
#!/bin/bash
cd /root
cat /root/hostname1.txt | while read... (1 Reply)
Discussion started by: jimmyf
1 Replies
LEARN ABOUT MOJAVE
net::dns::question5.18
Net::DNS::Question(3) User Contributed Perl Documentation Net::DNS::Question(3)NAME
Net::DNS::Question - DNS question record
SYNOPSIS
use Net::DNS::Question;
$question = new Net::DNS::Question('example.com', 'A', 'IN');
DESCRIPTION
A Net::DNS::Question object represents a record in the question section of a DNS packet.
METHODS
new
$question = new Net::DNS::Question('example.com', 'A', 'IN');
$question = new Net::DNS::Question('example.com');
$question = new Net::DNS::Question('192.0.32.10', 'PTR', 'IN');
$question = new Net::DNS::Question('192.0.32.10');
Creates a question object from the domain, type, and class passed as arguments. One or both type and class arguments may be omitted and
will assume the default values shown above.
RFC4291 and RFC4632 IP address/prefix notation is supported for queries in both in-addr.arpa and ip6.arpa namespaces.
decode
$question = decode Net::DNS::Question($data, $offset);
($question, $offset) = decode Net::DNS::Question($data, $offset);
Decodes the question record at the specified location within a DNS wire-format packet. The first argument is a reference to the buffer
containing the packet data. The second argument is the offset of the start of the question record.
Returns a Net::DNS::Question object and the offset of the next location in the packet.
An exception is raised if the object cannot be created (e.g., corrupt or insufficient data).
encode
$data = $question->encode( $offset, $hash );
Returns the Net::DNS::Question in binary format suitable for inclusion in a DNS packet buffer.
The optional arguments are the offset within the packet data where the Net::DNS::Question is to be stored and a reference to a hash table
used to index compressed names within the packet.
name
$name = $question->name;
Internationalised domain name corresponding to the qname attribute.
Decoding non-ASCII domain names is computationally expensive and undesirable for names which are likely to be used to construct further
queries.
When required to communicate with humans, the 'proper' domain name should be extracted from a query or reply packet.
$query = new Net::DNS::Packet( $example, 'ANY' );
$reply = $resolver->send($query) or die;
($question) = $reply->question;
$name = $question->name;
qname, zname
$qname = $question->qname;
$zname = $question->zname;
Canonical ASCII domain name as required for the query subject transmitted to a nameserver. In dynamic update packets, this attribute is
known as zname() and refers to the zone name.
qtype, ztype
$qtype = $question->qtype;
$ztype = $question->ztype;
Returns the question type attribute. In dynamic update packets, this attribute is known as ztype() and refers to the zone type.
qclass, zclass
$qclass = $question->qclass;
$zclass = $question->zclass;
Returns the question class attribute. In dynamic update packets, this attribute is known as zclass() and refers to the zone class.
print
$object->print;
Prints the record to the standard output. Calls the string() method to get the string representation.
string
print "string = ", $question->string, "
";
Returns a string representation of the question record.
COPYRIGHT
Copyright (c)1997-2002 Michael Fuhr.
Portions Copyright (c)2002-2004 Chris Reinhardt.
Portions Copyright (c)2003,2006-2011 Dick Franks.
All rights reserved.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
perl, Net::DNS, Net::DNS::DomainName, Net::DNS::Packet, RFC 1035 Section 4.1.2
perl v5.18.2 2014-01-16 Net::DNS::Question(3)