Score:0

shut down a script when it's detached from the terminal without kill

gr flag

I have a bash script task with following requirement:

"Script must be easy to shut down when it's detached from the terminal without having to resort to ps, pgrep, pkill and their like"

With my limited knowledge (and search), i couldn't see any method. Do you have any idea what they are referring to ?

Thanks

francois P avatar
in flag
maybe using traps & signals over the ID of the script ; but keep in mind there are not so much methods because it is not needed as far as all you mention ps/pgrep/pkill/kill and so on are just very satisfying methods & unix standard
signalz avatar
gr flag
@francoisP well its actually a task for job interview which is not very high level position. now im assuming that they just put that requirement for test me lol
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.