0

I'm having a discussion with my Operating Systems teacher about whether shell program can be used to communicate with another process. He says it can't while I believe it actually can.

For example: if we write echo "123" >> file.txt, and there is a process named P1 that reads data from this file, isn't it communication between those two processes?

Another example: There is a process P1 that waits for a file to be created in order to proceed. If we create that file by using touch file.txt, isn't it also considered as communication?

Is my teacher really right? If so, could someone please explain to me why? He gave me some examples about how can a process communicate with one another, such as: shared memory area, pipes or signals.

8
  • who is going to mark your exam - us or your operating systems teacher? I would put it in the "not what people traditionally mean when they say communication" basket. Having said that "touch files" are a heuristic I use all the time. Commented Mar 26, 2021 at 14:02
  • @MrR you see, the thing is... this exam was already marked by my OS teacher and I failed it. I'am literally 0.1% away from passing it and in order to get the additional 0.1%, I have to explain why shell program can not communicate with another process. I know the question is tricky and that it can be interpreted in so many ways, but every single sight could matter big time for me. When I read about IPC, there also was nothing about shell programms and I wonder why. Commented Mar 26, 2021 at 14:07
  • Normally it isn't the shell connecting to the other process, it sets up the communications but isn't doing the communication. e.g. cat file | programUsingFile .. the shell links them up but they are doing the communication .. OR you have something running in the shell connecting to a remote process. For instance TCL or Expect allow you to do interactive dialogs (say to do password entry on login).. Commented Mar 26, 2021 at 14:15
  • So if you run netcat in one Terminal like this nc -u -l 3000 and in another Terminal/process you run this echo "Told you so" > /dev/udp/127.0.0.1/3000 You should become an A* pupil ;-) Commented Mar 26, 2021 at 16:25
  • Maybe also ask what coproc is, if it isn't 'Inter-process Communication" gnu.org/software/bash/manual/html_node/Coprocesses.html Commented Mar 26, 2021 at 16:29

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.