I have a script (run.sh) which calls my application script. At a given time, I may have multiple run.sh running.
The general format of the run.sh script is,
#!/bin/bash
# Running DALTON JOB: Helix
dir=$(pwd)
echo "-----------------------------------------------"
export DALTON_TMPDIR=/mnt/raid0/scratch
export OMP_NUM_THREADS=6
source /opt/intel/compilers_and_libraries_2017.0.098/linux/bin/compilervars.sh intel64
source /opt/intel/mkl/bin/mklvars.sh intel64
echo "//-------process started----------------------------//"
./application.sh -mb 14550 input.mol output.out
echo "//-------process finished----------------------------//"
Is it possible to get the PID of the application.sh inside the run.sh script.
(I found that $$ gives the PID of the script itself.)
Also, I noticed that the PID of the application is always larger numerically than parent script but maybe its coincidence.
./application.shget run in the background? otherwise, it will have exited by the time run.sh could do anything with the PID.application.shruns in the background ( for ~3-4 hours) as a host process ofrun.sh.