you've written a function, which can only be called from lua, not from the command line. Running a file containing just this will only define the function "move(dist)", not actually call it. You can see that it's defined by running it, then running lua, and in lua typing "move(5)" which will cause your turtle to move forward 5 as expected.
Only code in a file that is
not inside a function will be executed when you run the program from the command line, and a little extra work is involved in taking command-line parameters as well.
--this grabs all command-line parameters to an array
local params={...}
--pull out the first parameter and make it into a number (command line params are all strings normally)
local distance=tonumber( params[1] )
--now your code from inside the function
for i = 1, distance do
turtle.forward()
end
hope this helps!