<div class="moz-text-plain" style="font-family: -moz-fixed; font-size: 12px;" lang="x-western"><pre>Here's the process I'm trying to follow. I have this working with a<br>bash script btw, just thought I'd take an adventure into perl.
<span class="moz-smiley-s1"><span> :) </span></span> <br><br>I'm trying to get my perl script to populate a serialnumber file by<br>sshing to the host and writing a file by one of 2 methods. (either way<br>root is inaccessible via ssh)
<br><br>Method 1: write the file to /tmp and move it to /etc.<br>Method 2: write to /etc.<br><br>Regardless of how I do this I need to get root (via 'su' or vi 'sudo')<br>to get the file into /etc<br>All the file work is done on the remote client after sshing to it while
<br>providing the information needed.<br>my $cmd = "echo \"HOST='$hos'\nASSET='$ass'\nSERIAL='$ser'\nMAKE='$mak'\nMODEL='$mod'\nFACILITY='$fac'\nRACK='$rac'\nUNITS='$uni'\"
<span class="moz-txt-citetags">> </span>$tmpf; sudo mv $tmpf /etc";<br></pre><pre><br>Hope this helps with a few questions.<br><br><br></pre></div>