When you press Enter at the end of:
for VARIABLE in file1 file2 file3
The shell can't execute anything since that
for loop is not finished. So instead, it will print a different prompt, the
$PS2 prompt (generally
>), until you enter the closing
> is displayed, you can't go back to edit the first line.
Alternatively, instead of typing Enter, you can type Ctrl-VCtrl-J. That way, the newline character (aka
^J) is entered without the current buffer being accepted, and you can then go back to editing the first line later on.
zsh, you can press Alt-Enter or EscEnter to insert a newline character without accepting the current buffer. To get the same behavior in
bash, you can add to your
\026 being the