Executing Shell commands in Perl 
Author Message
 Executing Shell commands in Perl

Quote:

> I am trying to execute shell commands in Perl with no success.  The
> shell version of what I am trying to do is as follows:

> #!/bin/sh

> taetm << done
> isisdoc FROMPDF=test.pdf
> exit
> done

> How do I translate this to perl?  Taetm is an application, and isisdoc
> is a program run under this application.  The FROMPDF=test.pdf is an
> argument passed to isisdoc, with the exit call terminating the taetm
> application after isisdoc is finished running.

> I have tried to execute this in perl with both the system() call and
> the Shell module.  Any help in this matter would be greatly appreciated!

it helps if you show us what you tried, and specifically what
error messages you got.

your arguments are:
$args = "isisdoc FROMPDF=test.pdf\nexit\n";
can you do
system "taetm $args";
 ??
how about

$cmd = <<CMD;
taetm << done
isisdoc FROMPDF=test.pdf
exit
done
CMD

system "$cmd";
--
==========================================================
 - darin

\\//\\//.\\//\\//.\\//\\//. http://www.*-*-*.com/
 '2 kinds of green, look out!' - dieter rot



Fri, 14 Jan 2000 03:00:00 GMT  
 Executing Shell commands in Perl


Quote:

>I am trying to execute shell commands in Perl with no success.

It sounds like you want to open a pipe to the taetm command, write
your arguments to it, then close the pipe.  Please read the info in
the perlipc man page.  I think the section labeled "using open() for
IPC" is what you're looking for.  There are excellent examples given
for calling shell programs from Perl.

Tim



Fri, 14 Jan 2000 03:00:00 GMT  
 Executing Shell commands in Perl

      open (IN,"isisdoc FROMPDF=test.pdf|") ;
      while (<IN>)
      {
            ...
      }

Will

Quote:

>I am trying to execute shell commands in Perl with no success.  The
>shell version of what I am trying to do is as follows:

>#!/bin/sh

>taetm << done
>isisdoc FROMPDF=test.pdf
>exit
>done

>How do I translate this to perl?  Taetm is an application, and isisdoc
>is a program run under this application.  The FROMPDF=test.pdf is an
>argument passed to isisdoc, with the exit call terminating the taetm
>application after isisdoc is finished running.

>I have tried to execute this in perl with both the system() call and
>the Shell module.  Any help in this matter would be greatly appreciated!

--
# Copyright 1997 Will Morse.  Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
#
#      Gravity,                    #    Will Morse
#      not just a good idea,       #    Houston, Texas

#
#   These are my views and do not necessarly reflect anyone else/


Sat, 15 Jan 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Trying to execute shell commands in perl

2. Executing Shell Commands in Perl

3. Executing Shell commands in Perl

4. How to: execute shell command with Perl

5. Executing a shell command within a perl script.

6. Executing UNIX shell commands in PERL

7. Executing a shell command within a perl script.

8. Can Perl execute a shell command?

9. Question: Using perl to execute shell commands

10. Executing multiple shell commands from Perl

11. Executing shell command?

12. Executing Here doc shell commands

 

 
Powered by phpBB® Forum Software