At first I didn't think this was a perl problem (and it still might not be), however I'm quickly running out of non-perl things that could cause this problem

I have a script that runs on boot. It basically takes some info, puts it into a text file, and then puts the text file on another box.

The line of code that produces the stty: standard input: Invalid argument error is

system("sudo -u username scp /tmp/bootbox21.txt mybox.mydomain:/export +/home/username/");

I first though this was caused by sudo trying to run one of the .bashrc or .bash_profile files. In /etc/bashrc I commented out the two lines which have an stty command, but that didn't help. Actually I didn't think it would since, they're only run if it is a login shell. There is no /etc/bash_profile. I then thought that ~/username/.bash_profile might have some problem (there is no .bashrc file for the user). I eventually went so far as to completely rename it so it wouldn't be found. Still no luck.

So now I'm starting to wonder if it isn't some weird perl gotcha with the system command using sudo. Can anyone help with this?


In reply to stty: standard input: Invalid argument by xorl

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.