KannanRG KannanRG - 8 months ago 20
Bash Question

Bash executing multiple commands in background in same line

When i try to execute

-bash-3.2$ cd /scratch/;nohup sh xyz.sh>>del.txt &;exit

I am getting following error..

-bash: syntax error near unexpected token `;'

I am trying to run a detached process using nohup .. & . ';' works fine for all other commands except
nohup sh xyz.sh>>del.txt &;

can anyone tell the problem here . Thanks


You can try putting your command between quotes if you are in a bash shell

cd /scratch/ ; `nohup sh xyz.sh>>del.txt &` ; exit

you can take a look at this question