First just issue the command as usual and add "&" to it. (my "\" is where I'm breaking a line for reading ease but where YOU should not have a line break in your commandline):
% cd /home/gawron/hmm_tagger/ % tagger data/train.tag \ data/test.txt > test1.tag &I'm running a tagger with a training corpus and a test corpus and I'm redirecting its STD_OUT to a file called "test1.tag".
Now I can keep issuing other commands from the same shell.
But just backgrounding a job with "&" won't work if I now log out. When my shell job gets killed, so do all its daughters.
Here's the way to run a batch job in the background so you can log off and have it run and direct output to a file when you're not around.
Note: this is definitely the right thing to do if you are working from home, ssh-ing to some other machine than bulba (which you are all doing in order not to overload bulba), and then logging out to go surfing (I dont mean on the web).
/home/gawron/hmm_tagger/tagger /home/ling581/hmm_tagger/data/train.tag \ /home/ling581/hmm_tagger/data/test.txt \ 1>/home/gawron/hmm_tagger/test1.tag \ 2>/home/gawron/hmm_tagger/test1.errSo I'm running the same program from the last example, a program called tagger in /home/gawron/hmm_tagger/tagger, and I'm redirecting STD_OUT to the same file as before, file test1.tag, but I'm saying so explicitly with "1>" instead of ">", and I'm redirecting STD_ERR to the file test1.err. Notice I'm using full pathnames. Do that!
Each time you run this remember the std* files created from the last run will be overwritten. If you want to save them, move them.
batch_job is a script file and needs to be executable. I make this happen from the Unix shell:
% at -f batch_job 14:09The name of a file containing the command comes after '-f' and I put the time I want it to run (14:09) last. Note: Make that time in the future or it runs tomorrow!