"Enter" button

When I press “Enter” button in the terminal to create a new line, program starts running. How can I prevent it?

you could put a backslash to escape the enter:

 echo \
> hello world

i pressed the enter key after the backslash, or use quotes:

 echo 'hello
>  world'

then bash knows you are not done typing.

and then there is EOF (end of file):

https://stackoverflow.com/questions/2500436/how-does-cat-eof-work-in-bash

1 Like