Hi,
I'm trying to run nsradmin via a Perl script (see below). The script doesn't use a
temporary file. I notice that *unless* I specify a "show attribute" command
like:
print WTRFH "show name\n";
the script just hangs. It doesn't seem to like just "show\n" by itself. This
also causes the script to hang. I want all the attributes to get printed. I even tried:
print WTRFH ". type:NSR client\n";
print WTRFH "print\n";
It still only works if I specify the attribute on the show command fist. This
makes no sense as it works fine within nsradmin. Also, it works if I create a
temp file with the following:
print type:NSR client
and then I run nsradmin -s server -i temp_file
Isn't my script doing the same thing????
Any ideas?
Thanks.
George
#!/free/bin/perl
my $program = "nsradmin";
@args = ("-s", "orion", "-i", "-");
use IPC::Open2;
my $pid = open2(\*RDRFH, \*WTRFH, "$program", @args) or die "can't open pipe to
$program: $!";
# Send commands to nsradmin.
# print WTRFH "show name\n";
print WTRFH "print type:NSR client\n";
close (WTRFH);
waitpid($pid, 0);
# get the results.
my @output = <RDRFH>;
print @output;
To sign off this list, send email to listserv AT listserv.temple DOT edu and type
"signoff networker" in the
body of the email. Please write to networker-request AT listserv.temple DOT edu
if you have any problems
wit this list. You can access the archives at
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
|