Dear Monks, I need your esteemed wisdom.
I am trying to run an scp command on a ermote system which I am pretty sure is being split at the whitespace between the 2 arguments. I have tried every trick in my library to no avail. How do I avoid the command being split into 2 lines? The code is below:
$command = "scp $user\@$ip:$source/$_ $staging/$_";<br> print("$command\n");<br> system($command);<br>
and the output:
scp daylite_backup@192.168.0.53:/home/staging/dayliteLeads/courseBooki +ngs/1116932421807.xml <br> /dayliteImports/staging_courses/1116932421807.xml <br> usage: scp [-pqrvBC1246] [-F config] [-S program] [-P port]<br> [-c cipher] [-i identity] [-l limit] [-o option]<br> [[user@]host1:]file1 [...] [[user@]host2:]file2<br> sh: line 2: /dayliteImports/staging_courses/1116932421807.xml: No such + file or directory

Janitored by holli - added code tags


In reply to system call and newline interpretattion. by jaimeGonz

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.