So, I have three programs. One shell script foo.sh, two perl scripts
bar.pl, server.pl
foo.sh:
#!/bin/bash
./server.pl & #or use: "sleep 10 &" to test it
echo "1"
bar.pl:
#!/usr/bin/perl
my $ret = `./foo.sh`
print "$ret\n";
server.pl:
just a script that is in a while(1) loop and waits for incoming
connections.
the problem that I am having is that bar.pl is waiting for foo.sh to
finish but somehow bar.pl also seems to wait for the server.pl to
finish even though it is supposed to be running in the background (I
also tried it with nohup and that still didnt work).
I also need to be able to read what foo.sh prints to STDOUT.
How can I do this so that bar.pl doesnt hang?
thanks
dometz