en su secuencia de comandos puede establecer una espera. wait 10
esperaría 10 segundos y en cuanto a salir del programa sin CTRL + C
busque en el comando exit
. Si usa exit 0
, significa que está bien. Hay diferentes versiones, pero no sé lo que significan exactamente fuera de mi cabeza.
exit 1
exit 2..... so on and so forth
actualización
@ Celada
No hay necesidad de golpear. Podrías haber dicho "quizás no entendiste la pregunta correctamente" Stackoverflow está aquí para ayudar a la gente a aprender, no para derribarlos. Inventaron a Reddit por eso. En cuanto a los códigos de salida, puede forzar al programa a salir emitiendo el comando exit() con un código. Directamente desde linux.die.net.
Exit Code Number Meaning Example Comments
1 Catchall for general errors let "var1 = 1/0" Miscellaneous errors, such as "divide by zero"
2 Misuse of shell builtins (according to Bash documentation) Seldom seen, usually defaults to exit code 1
126 Command invoked cannot execute Permission problem or command is not an executable
127 "command not found" Possible problem with $PATH or a typo
128 Invalid argument to exit exit 3.14159 exit takes only integer args in the range 0 - 255 (see footnote)
128+n Fatal error signal "n" kill -9 $PPID of script $? returns 137 (128 + 9)
130 Script terminated by Control-C Control-C is fatal error signal 2, (130 = 128 + 2, see above)
255* Exit status out of range exit -1 exit takes only integer args in the range 0 - 255
¿Qué quiere decir exactamente enviando Ctrl + C en forma de texto? – betabandido