Announcement

Collapse
No announcement yet.

Kill command and suppress output

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Kill command and suppress output

    I have written a bash script. When the user inputs no data, the script displays sends an error message to stdout and kills the process. That is working well. The user gets the error message, and the next line says "Killed." I want to stop "Killed" from being displayed at all. In other words, I want the user to get the error message and be dumped back into the ordinary bash prompt, without seeing "killed" or "terminated" or anything else.

    I have spent an hour playing around with redirecting the output of the kill command to /dev/null, and I'm pretty sure that at this point I have tried all of the possible variations . . . except the correct one, which I cannot seem to determine. Can someone help me out?

    Many thanks.

    #2
    Look at this! Here I am talking to myself (again).
    After some more (lucky) research, I found an answer. The command "kill -13 killobject" works perfectly. Thanks to Snowhog, jglen, and vinny for reading this. Thanks to luck for my solving it.

    Comment


      #3
      Well, good for you
      The next brick house on the left
      Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.27.11​| Kubuntu 24.04 | 6.8.0-31-generic



      Comment


        #4

        Why don't you just exit the script? killing itself in order to make it go away is ... unusual.

        What kind of window is the script running in? Is it that you want that window to close?
        Regards, John Little

        Comment

        Working...
        X