Actually, this has nothing to do with ssh either... it's just a Unix problem. You are trying to redirect the output of cat into a directory. If you copied the file, cp would know the input file name and could use it to create the output file. Redirection with ">" doesn't do that... you have to tell it the name of the file explicitly. I think you can just change:
cat > /users/merc/tmp
to
cat > /users/merc/tmp/pars_rem.pl
---

By the way... why are you chmod'ing /users/sword/tmp just before you execute it? Did you mean /users/merc/tmp?

Also, if you want to remove the pars_rem.pl you need to put the command in,

rm /users/merc/tmp/pars_rem.pl
Hmm... you have the same file name on both systems... remember to back up the file to a different name in case the rm ever gets executed on the wrong one. Even better, change the name on one system or the other.

Another, possibly simpler, approach would be to just have perl execute its own standard input, so you don't need to use a temporary file at all,

perl -w -

In reply to Re: ssh help by quester
in thread ssh help by mercuryshipz

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.