To run my Matlab scripts, I've created a shell script to which I give two parameters - the path to the matlab file ($1
) and to the log file ($2
):
nohup time matlab -some_parameters -r "run $1;exit" &>> "$2" &
When I need to kill one of the Matlab processes, it's sometimes difficult to tell which one is which. Would it be possible to somehow include the pid of the Matlab process in the log file (i.e. in $2
)?