hi all,
I have a sh script where I need to execute the nc command in the background (I need that nc still running after the script finish)
BUT Im seeing the nc command is executed but after a couple of seconds dissapear in the ps command
This is my script
Code:
#!/bin/sh
CURRENT_FILE="curfile.txt"
PID_FILE="file.pid"
> $CURRENT_FILE
java -jar javaApp.jar -file $CURRENT_FILE &
AV_PID=$!
nc -l 64001 >> $CURRENT_FILE &
NC_PID=$!
echo -e "$AV_PID \n $NC_PID" > $PID_FILE
Do you have ay idea why the nc is stopping working?
in the file.pid Im seeing both pids, but when I try the ps file, Im only seeing the pid of the javaApp.
Please help....