hercsub 192.168.1.102:3505 dummy.jcl
hercsub /tmp/hercrdr.00C dummy.jcl
Here is the Hercsub script:
============== hercsub ================
#!/usr/bin/perl
use Socket;
use IO::Socket::UNIX;
use IO::Socket::INET;
if (@ARGV < 1) {
print STDERR "Usage: hercsub socket_spec [job]\n";
exit 2;
}
my $spec = shift @ARGV;
my $sock;
if ($spec =~ m{^/}) {
$sock = IO::Socket::UNIX->new(Peer => $spec);
} else {
$sock = IO::Socket::INET->new(PeerAddr => $spec);
}
die "Failed to connect to socket $spec: $!\n" unless defined($sock);
while (<>) {
print $sock $_;
}
========== end of hercsub =============
Figure 354: The Hercsub Perl Script
15.3.2 Using the netcat program
The netcat (nc) program can also be used to submit files to a Hercules reader via TCP/IP. Install netcat
(which is useful for many other things as well) and use the following syntax:
nc –w1 localhost 1234 < dummy.jcl
For more information on the netcat program, type man nc from the Unix shell.