Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with executing mv from perl

Status
Not open for further replies.

patso

IS-IT--Management
May 19, 2000
5
US
I've been having this problem using move in perl where I have two scalar values, one for the file being move one for the destination, but it constantly comes back with an error saying that I didn't specify the first argument.&nbsp;&nbsp;Well here's the code snippet:<br>$i=0;<br>while($i &lt;= $#files)<br>{<br>#moves parsed files to the parsed directory<br>@array = split (/logs\//, $files[$i]);<br>$fileWrite=$array[1];<br>print &quot;$fileWrite\n&quot;;<br>`mv $files[$i] /home/patso/src/perlScripts/LogParser/parsed/`;<br>print &quot;$files[$i]\n\n&quot;;<br>$i++;<br>}<br><br>...it's basically trying to move the logs that have been parsed to another directory.&nbsp;&nbsp;I'v tried using only the small piece of code in another script by itself and it works, but in the other one it doesn't.&nbsp;&nbsp;Can anyone help?<br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top