Question

​​​​​​​In Linux Programming: What is the difference between running program with and without exec? Why do...

​​​​​​​In Linux Programming:

  1. What is the difference between running program with and without exec?
  2. Why do we need 3 sets of file permission for a file or folder?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ans 1 )execa shell built-in, which replaces the image of the current process with new process. It's not same as calling a binary/executable.

To see the difference, do:

#script1 python test.py echo Hello #script2 exec python test.py echo Hello 

You will not see the Hello getting printed in the second script.

exec also another purpose in shells. It can be used for redirection. For example,

 exec 1>file 

redirects the stdout of the process to file.

If you had:

 exec 1>file echo hello echo world 

then script would redirect hello and world to file instead of stdout.

Ans 2) We need three file permissions to give allow usage permissions to different set of people using that file those would be the owner of file,group and the world.

Add a comment
Know the answer?
Add Answer to:
​​​​​​​In Linux Programming: What is the difference between running program with and without exec? Why do...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT