<div class="moz-text-plain" style="font-family: -moz-fixed; font-size: 12px;" lang="x-western"><pre>Here&#39;s the process I&#39;m trying to follow.  I have this working with a<br>bash script btw, just thought I&#39;d take an adventure into perl. 
<span class="moz-smiley-s1"><span> :) </span></span> <br><br>I&#39;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 &#39;su&#39; or vi &#39;sudo&#39;)<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 = &quot;echo \&quot;HOST=&#39;$hos&#39;\nASSET=&#39;$ass&#39;\nSERIAL=&#39;$ser&#39;\nMAKE=&#39;$mak&#39;\nMODEL=&#39;$mod&#39;\nFACILITY=&#39;$fac&#39;\nRACK=&#39;$rac&#39;\nUNITS=&#39;$uni&#39;\&quot; 
<span class="moz-txt-citetags">&gt; </span>$tmpf; sudo mv $tmpf /etc&quot;;<br></pre><pre><br>Hope this helps with a few questions.<br><br><br></pre></div>