60
votes
4answers
1k views

Can I somehow add a “&& prog2” to an already running prog1?

Most shells provide functions like && and ; to chain the execution of commands in certain ways. But what if a command is already running, can I still somehow add another command to be executed ...
3
votes
1answer
355 views

wait does not wait

If i have a file called myprogram containing sleep 200 date Run this in the background: $ sh myprogram & i want to know when myprogram has completed by using wait command $ cat >notify ...
1
vote
2answers
1k views

How to pass data outside process for zenity progress?

Usually this would be a question about how to pass data from a subprocess to a main process, but maybe zenity has some extra quirks so please focus on zenity. Example: #!/bin/sh ( echo "10" ; sleep ...
4
votes
1answer
95 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
628 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?
5
votes
1answer
240 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 ...
2
votes
2answers
646 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 ...