I have written a script to split my pdf files between pages I give, and compress them using gs and then output it to a pdf file.
I want to run my script in the background, but am I missing something? I should use & at the end of line, but it still prints output. so I use:
./gs 12 20 temp > /dev/null &
but it just goes to the background and I should use fg to run it actually.
so what is it I am missing? & should send the process to background but it stops at background. I want it to run in background.
edit:
problem is solved. it was my mistake to look for wrong file the script creates.
it works like a charm!
The output is from your shell. When you background a job, it prints the job id
[1]and the process id9324so that you have a way to manipulate your background jobs. It indicates that the job is in fact running in the background.To bring it back to the foreground,
fg %1(to refer to the job id, use a percent sign) or to kill it,kill 9324.