scripting - Terminate shell code while it is running -


for clearing screen in shell code if write ctrl + l

printf "\033c" 

then shall done ctrl + c ?

just exit not working in code because handling errors , in case of bad inputs have run code again , when unseting variables unset working fine later again code shows output no input variables.

if understand correctly want do, should use trap command. trap prevent shell default handling , allows interrupt, quit, hangup etc. doing.

the syntax following

trap <command execute> <signal intercept> 

so like

trap break int 

to have equivalent of ctrl-c.


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -