Hello:

I am trying to write a script which starts a program and then I need to run a few more commands to modify this running program. My problem is that once I start my program I only come back to the script once this program is terminated by the user. I know I could use the exec() call to start the program and then proceed to run the rest of my commands. However, I would like to only run two more commands and then wait for the program to be terminated by the user. So being able to run a system() call with multiple commands would be ideal for me. Is there any way I can do this ?

I tried doing something like this, which didn't work.
system ("vp -e " . $ENV{'VREL'} ; "vscmd set-measure-mode fast";"vscmd + pg-address-check off");
I know this code will do what I need. However I need a way to know when my vp program gets terminated by the user so I can run a few more commands.
exec ("vp -e " . $ENV{'VREL'} ); exec( "vscmd set-measure-mode fast"); exec("vscmd pg-address-check off");
Thanks for any help.

In reply to Multiple commands with one system call by renzosilv

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.