in reply to Auto Feeding Data to Unix Programs

Are you trying to send text to the execopu program? If so, check out Perl's open(FH, '|...') function:

#!/usr/bin/perl open(EXECOPU, '| execopu -text') or die("Can't run execopu: $!\n"); my @site_numbers = (7, 12); print EXECOPU "cell\n"; foreach my $site_number (@site_numbers) { print EXECOPU <<"EOF"; u csno = $site_number ccuoosmin_3g1x = "" ccuoos_3g1x = "" u EOF }

You might also want to check our IPC::Open2, IPC::Open3 and IPC::Run, especially if you want to capture the output.

Replies are listed 'Best First'.
Re^2: Auto Feeding Data to Unix Programs
by awohld (Hermit) on Apr 19, 2005 at 22:39 UTC
    Yes, I am trying to send all that text to the "execopu" program. It keeps on prompting me for input and I need to feed it automatically.
Re^2: Auto Feeding Data to Unix Programs
by awohld (Hermit) on Apr 19, 2005 at 23:12 UTC
    When I feed "u" to the script I get this error:

    FD00 - Cannot convert ODIN stringwad to subschema. Check for a null field and/or verify the RC/V product and mask are compatible.

    Any idea if a null field is getting fed?
      What's a null field? I'm not familiar with execopu, so you'll have to give us more info. I think you might need to remove the "u" at the bottom of the heredoc (i.e. I think you might need to delete the second line with the "u", right before the EOF).