This is my perl code to move result to the sent folder.
system("mv /home/pi/downloads/$result /home/pi/downloads/sent/$result");
The error i get is:
mv: missing destination file operand after `/home/pi/downloads/filename.txt'
What am i doing wrong here?
That’s difficult to say but there’s a few things you can do that should help you solve it.
First make sure your script starts like this:
Notice the -w to enable warnings. Also
use strictwill help you identify code issues.Another thing that helps a lot is storing the command you want to run in a scalar and printing it to see what it is actually doing:
In your script do you get the value for $result from user input? I have a feeling it has a newline character. The chomp function will safely remove newline characters from the end of a string.