The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
2answers
2k views

Exit Google Chrome from terminal

Is there a way to cause google-chrome to quit, from the terminal, besides using killall google-chrome? I would like to be able to close it from a script without killing it.
9
votes
3answers
1k views

Is it safe to close shell just by clicking “X” or using “ctrl+d”?

Is it safe to close shell just by clicking "X" or using "ctrl+d" while logged in as root with su or is it safer to close it by typing "exit"? Is there any difference (security-wise) at all or is it ...
4
votes
1answer
98 views

Is it the process that cleans itself on termination or the kernel?

Recently I found this in a powerpoint presentation: When a program is compiled and linked, the linker inserts some extra code in the program. It is this code that calls the main function about the ...
2
votes
3answers
759 views

What is meant with terminating a process normally?

In an examination it is stated: Give 2 different ways that a process can terminate normally. Describe the differences. What is meant with terminate normally?
3
votes
1answer
159 views

Testing equivalence for exit status

Are the following two command lists portably equivalent? $foo; echo $? #(1) and $foo && echo 0 || echo $? #(2) Postscript Consider the command exit-status defined so: #!/bin/sh exit ...
5
votes
1answer
262 views

Return value of a process and comparison of the number

I have a val.py python script that returns a negative number. import sys sys.exit(-1234) When I run this bash script, I get the value $? as return value of 46 (not -1234). Even when I tried to ...
4
votes
2answers
153 views

Unable to capture program exit

I started a program written using Node.js and started it using launch pipe into logfile and send it to background. Half way running the program exited w/o any error both on the console nor the log, I ...
3
votes
2answers
471 views

How to use $? and test to check function?

#!/bin/sh function checkExit(){ if test "$?" != "0"; then echo Command $1 exited with abnormal status exit 1; else echo $? fi } function echoThenRun () { # echo and then ...
2
votes
2answers
454 views

.DELETE_ON_ERROR behavior with make and pipelines

The .DELETE_ON_ERROR target will tell make to delete a target if a rule fails. But this doesn't work for pipelines, because the exit status value $? holds the value of the last program in the ...
2
votes
2answers
747 views

Removing zombie process from the process table

Can somebody please explain when parent process receives the exit status of a dead child process via wait, who actually reallocates the memory of the child process and removes it from the process ...
5
votes
4answers
1k views

Why can't I get the exit values of a command in this bash script?

So I was writing this little nautilus script for transcoding video into mp3: #! /bin/bash -x if [ -z "$1" ] then zenity --warning --text="Error - No file selected !" exit 1 fi ...
48
votes
12answers
16k views

Get exit status of process that's piped to another

I have two processes foo and bar, connected with a pipe: $ foo | bar bar always exits 0; I'm interested in the exit code of foo. Is there any way to get at it?
2
votes
2answers
990 views

dhclient exits with status 0 but still no address

I've been trying to find out with the man page and some other sources if the exit status doesn't necessarily mean you achieved an address but I'm thinking I maybe didn't read it correctly. Does anyone ...
8
votes
4answers
2k views

Why should a child of a vfork or fork call _exit() instead of exit()?

From the man page of vfork(): vfork() differs from fork() in that the parent is suspended until the child makes a call to execve(2) or _exit(2). The child shares all memory with its ...