Hope you can help me to resolve this problem.
For school I have to transform Ctrl+C to a command which doesn\'t shut down the shell, but he reminds through
As you're talking about doing it from the shell, you probably want:
$ trap "echo Please type \'exit\' to close the shell." SIGINT
Please type 'exit' to close the shell.
$
This specifies a command to execute when the listed signal is trapped (the trap
command can also trap other signals; SIGINT is the one generated by Ctrl-C
). The \'
protects the quote from being interpreted by the shell.