I am trying to run a script in the background using '&' at the end of the command, but apparently, it isn't working out.This is the issue I am facing. To use a paid simulation software, the provider has instructed me to run a certain script to enable license access. I am to leave this open and start the software from another terminal (in batch mode without GUI, since I am using a supercomputing cluster).Trouble is, I can only send one script to the scheduler in the head node (which I am connected through ssh), and the job is forwarded to one of the compute nodes. So instead of starting a new terminal to run the software, I attempted to run the provided script in the background using '&'. This didn't work out. It appears the connection to the license server is getting closed as soon as it's started with this method../script1.sh &Using xterm -e sh script1.sh to open it in another terminal gave the following error-xterm: Xt error: Can't open display: xterm: DISPLAY is not setAny help would be greatly appreciated.
Keeping Subshell running in the background
shell script;shell
Sounds like the job you submit needs to be one which performs both tasks.#!/bin/shlicense </dev/null >license.out 2>&1 &license_pid=$!simulatorkill $license_pidwait $license_pidThis saves standard output and standard error from the licensing process to a file so you can tail that to see what it wants to tell you if there should be a problem.