{"action":"opened","issue":{"url":"https://api.github.com/repos/kvz/bash3boilerplate/issues/47","repository_url":"https://api.github.com/repos/kvz/bash3boilerplate","labels_url":"https://api.github.com/repos/kvz/bash3boilerplate/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/kvz/bash3boilerplate/issues/47/comments","events_url":"https://api.github.com/repos/kvz/bash3boilerplate/issues/47/events","html_url":"https://github.com/kvz/bash3boilerplate/issues/47","id":168377112,"number":47,"title":"Add CTRL-C trapping","user":{"login":"gdevenyi","id":3001850,"avatar_url":"https://avatars.githubusercontent.com/u/3001850?v=3","gravatar_id":"","url":"https://api.github.com/users/gdevenyi","html_url":"https://github.com/gdevenyi","followers_url":"https://api.github.com/users/gdevenyi/followers","following_url":"https://api.github.com/users/gdevenyi/following{/other_user}","gists_url":"https://api.github.com/users/gdevenyi/gists{/gist_id}","starred_url":"https://api.github.com/users/gdevenyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdevenyi/subscriptions","organizations_url":"https://api.github.com/users/gdevenyi/orgs","repos_url":"https://api.github.com/users/gdevenyi/repos","events_url":"https://api.github.com/users/gdevenyi/events{/privacy}","received_events_url":"https://api.github.com/users/gdevenyi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-29T17:44:52Z","updated_at":"2016-07-29T17:44:52Z","closed_at":null,"body":"We can trap CTRL-C and call a function in bash:\r\nhttps://rimuhosting.com/knowledgebase/linux/misc/trapping-ctrl-c-in-bash\r\n\r\n```sh\r\n# trap ctrl-c and call ctrl_c()\r\ntrap ctrl_c INT\r\n\r\nfunction ctrl_c() {\r\n        echo \"** Trapped CTRL-C\"\r\n}\r\n```\r\n\r\nI don't have a use case right now, but it's definitely helpful to allow graceful cleanup of an interrupted script."}}
{"actor":{"display_login":"gdevenyi"}}