Monday, January 12, 2015

Using one line command as input for LSF bsub

In a simple case, you can use bsub command arguments to submit your command job to LSF cluster.

If you have a complicated script with many commands,  you can save into a lsf script (including the shell pathname in the first line) and then submit that script to LSF cluster, e.g.  bsub yourscript arguments

In your script, you wrote something like this:

myFirstArgument = $1

Here I found I can also use pipe to connect multiple commands into one line and simply quote them as one command and works in bsub. Here is an example:

bsub "echo -ne 'ab\tcss' | awk '{print \$2}'"

So far, I found I have to add "\" (backslash) to escape the special character, such as $ in awk. Wondering there might be a way in bsub options to set this.

1 comment:

  1. 您好!我现在在美国做博后,非常欣赏你的博客,我做了一个BJC( bioinformatics Journal club)的博客和论坛. 。我想通过大家交流一些最新的生物信息paper,抓住前沿. 希望可以交换友情链接.我的邮箱