A few ways to do this. First, the way you're trying to do this. You want to spawn "/bin/sh". And the first thing you want to do is expect a prompt, and then send it "cvs login". Then when that is done, you can send the shell more commands.

Alternately, you can spawn cvs login, and once that is done, you can use chdir (in perl, don't send it anywhere), and then you can just use system to run your import. Note here that I generally like to use the list version of system, not the single string version:

system(qw(cvs import -m), "First configuration", qw(apache/dd ebizad +min start));
although the way you're doing it would work, too. You can also get rid of the backslashes by using different surrounding quotes:
system('cvs import -m "First configuration" apache/dd ebizadmin star +t');
Have you sent a note to the author of the Cvs module to ask about adding the import functionality?


In reply to Re: automating some cvs commands by Tanktalus
in thread automating some cvs commands by Anonymous Monk

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.