Well i was just wondering how i can run like two while loops at the same time. I have heard of done& on a while loop and all but when i tried to use that it failed in the end. I have also heard using like a fork loop which i still don’t understand.
if anyone has ideas can you give me a little example script so I can understand.
Also I am not rejecting done& and fork loops just don’t know how to use them properly.
When you run the above script, the while loops are run as separate processes and they can’t “see” the variable
timeas they’ll have them as their own local variables. In order to send the data across processes, you have to use an IPC mechanism.You can create a named pipe using
mkfifoand send thetimevalue from one process to another. The following a simple example of what you are trying to do:At the end of it, don’t forget to delete the pipe. Simply do:
rm mypipe(you can see it in your current directory with:ls -l mypipe).