Yes, that is how an Interpreter works, OTOH a compiler compiles a script/program into binary code that can be executed directly.
_________________________
There are two types of vessels, submarines and targets.