Relative Content

Tag Archive for unix

how to send email using unix command

enter code here def send_email(hostname, target_directory, source_size, target_space): “””Send an email notification if there is insufficient space.””” subject = f”Insufficient space alert on {hostname}” body = (f”Host: {hostname}n” f”Target Directory: {target_directory}n” f”Required Space: {source_size} bytesn” f”Available Space: {target_space} bytesn” “Please take necessary action to free up space.”) command = f’echo “{body}” | mailx -s “{subject}” […]

Why do we need fork to create new process

In Unix whenever we want to create a new process, we fork the current process i.e. we create a new child process which is exactly the same as the parent process and then we do exec system call to replace the child process with a new process i.e. we replace all the data for the parent process eith that for the new process.
Why do we create a copy of the parent process in the first place and why don’t we create a new process directly? I am new to Unix please explain in lay-man terms.

Why do we need fork to create new process

In Unix whenever we want to create a new process, we fork the current process i.e. we create a new child process which is exactly the same as the parent process and then we do exec system call to replace the child process with a new process i.e. we replace all the data for the parent process eith that for the new process.
Why do we create a copy of the parent process in the first place and why don’t we create a new process directly? I am new to Unix please explain in lay-man terms.

Why do we need fork to create new process

In Unix whenever we want to create a new process, we fork the current process i.e. we create a new child process which is exactly the same as the parent process and then we do exec system call to replace the child process with a new process i.e. we replace all the data for the parent process eith that for the new process.
Why do we create a copy of the parent process in the first place and why don’t we create a new process directly? I am new to Unix please explain in lay-man terms.