Skip to main content
Clear up the stuff about the job submission message
Source Link
Kevin E
  • 554
  • 5
  • 14

I do not have the wherewithal to test using the specific programs mentioned in your example.

However, what you're asking for is possible with the -I (dash capital eye) option to bsub. The only catch is that the job submission message is sent to stdout by default, too, which will get mixed in with the expected actual output of your program:

Job <123456> is submitted to default queue <normal>.

That seems like a bug in LSF (should go to stderr). A solutionworkaround courtesy this SO answer is:

BSUB_QUIET=1 bsub -I cmd-that-writes-to-stdout | cmd-that-reads-from-stdin

Note that the actual value of the BSUB_QUIET environment variable apparently doesn't matter; it just needs to be defined in the environment.

For one-off commands, you can pipe the output of one bsub -I into another bsub -I, no problem:

$ export BSUB_QUIET=1

$ bsub -I grep ^root /etc/passwd
root:x:0:0:root:/root:/bin/bash

$ bsub -I grep ^root /etc/passwd | bsub -I awk -F: '{print \$6}'
/root

You would have to be careful to quote or escape shell metacharacters like $, though, if they appear somewhere in your command(s). This is another good reason to simply use a standalone script, as others suggested.

Hope that helps.

I do not have the wherewithal to test using the specific programs mentioned in your example.

However, what you're asking for is possible with the -I (dash capital eye) option to bsub. The only catch is that the job submission message is sent to stdout by default, which will get mixed in with the expected actual output of your program:

Job <123456> is submitted to default queue <normal>.

A solution courtesy this SO answer is:

BSUB_QUIET=1 bsub -I cmd-that-writes-to-stdout | cmd-that-reads-from-stdin

Note that the actual value of the BSUB_QUIET environment variable apparently doesn't matter; it just needs to be defined in the environment.

For one-off commands, you can pipe the output of one bsub -I into another bsub -I, no problem:

$ export BSUB_QUIET=1

$ bsub -I grep ^root /etc/passwd
root:x:0:0:root:/root:/bin/bash

$ bsub -I grep ^root /etc/passwd | bsub -I awk -F: '{print \$6}'
/root

You would have to be careful to quote or escape shell metacharacters like $, though, if they appear somewhere in your command(s). This is another good reason to simply use a standalone script, as others suggested.

Hope that helps.

I do not have the wherewithal to test using the specific programs mentioned in your example.

However, what you're asking for is possible with the -I (dash capital eye) option to bsub. The only catch is that the job submission message is sent to stdout, too, which will get mixed in with the expected actual output of your program:

Job <123456> is submitted to default queue <normal>.

That seems like a bug in LSF (should go to stderr). A workaround courtesy this SO answer is:

BSUB_QUIET=1 bsub -I cmd-that-writes-to-stdout | cmd-that-reads-from-stdin

Note that the actual value of the BSUB_QUIET environment variable apparently doesn't matter; it just needs to be defined in the environment.

For one-off commands, you can pipe the output of one bsub -I into another bsub -I, no problem:

$ export BSUB_QUIET=1

$ bsub -I grep ^root /etc/passwd
root:x:0:0:root:/root:/bin/bash

$ bsub -I grep ^root /etc/passwd | bsub -I awk -F: '{print \$6}'
/root

You would have to be careful to quote or escape shell metacharacters like $, though, if they appear somewhere in your command(s). This is another good reason to simply use a standalone script, as others suggested.

Hope that helps.

Give an example of piping 'bsub -I' into 'bsub -I'
Source Link
Kevin E
  • 554
  • 5
  • 14

I do not have the wherewithal to test using the specific programs mentioned in your example.

However, what you're asking for is possible with the -I (dash capital eye) option to bsub. The only catch is that the job submission message is sent to stdout by default, which will get mixed in with the expected actual output of your program:

Job <123456> is submitted to default queue <normal>.

A solution courtesy this SO answer is:

BSUB_QUIET=1 bsub -I cmd-that-writes-to-stdout | cmd-that-reads-from-stdin

Note that the actual value of the BSUB_QUIET environment variable apparently doesn't matter; it just needs to be defined in the environment.

For one-off commands, you can pipe the output of one bsub -I into another bsub -I, no problem:

$ export BSUB_QUIET=1

$ bsub -I grep ^root /etc/passwd
root:x:0:0:root:/root:/bin/bash

$ bsub -I grep ^root /etc/passwd | bsub -I awk -F: '{print \$6}'
/root

You would have to be careful to quote or escape shell metacharacters like $, though, if they appear somewhere in your command(s). This is another good reason to simply use a standalone script, as others suggested.

Hope that helps.

I do not have the wherewithal to test using the specific programs mentioned in your example.

However, what you're asking for is possible with the -I (dash capital eye) option to bsub. The only catch is that the job submission message is sent to stdout by default, which will get mixed in with the expected actual output of your program:

Job <123456> is submitted to default queue <normal>.

A solution courtesy this SO answer is:

BSUB_QUIET=1 bsub -I cmd-that-writes-to-stdout | cmd-that-reads-from-stdin

Note that the actual value of the BSUB_QUIET environment variable apparently doesn't matter; it just needs to be defined in the environment.

Hope that helps.

I do not have the wherewithal to test using the specific programs mentioned in your example.

However, what you're asking for is possible with the -I (dash capital eye) option to bsub. The only catch is that the job submission message is sent to stdout by default, which will get mixed in with the expected actual output of your program:

Job <123456> is submitted to default queue <normal>.

A solution courtesy this SO answer is:

BSUB_QUIET=1 bsub -I cmd-that-writes-to-stdout | cmd-that-reads-from-stdin

Note that the actual value of the BSUB_QUIET environment variable apparently doesn't matter; it just needs to be defined in the environment.

For one-off commands, you can pipe the output of one bsub -I into another bsub -I, no problem:

$ export BSUB_QUIET=1

$ bsub -I grep ^root /etc/passwd
root:x:0:0:root:/root:/bin/bash

$ bsub -I grep ^root /etc/passwd | bsub -I awk -F: '{print \$6}'
/root

You would have to be careful to quote or escape shell metacharacters like $, though, if they appear somewhere in your command(s). This is another good reason to simply use a standalone script, as others suggested.

Hope that helps.

Source Link
Kevin E
  • 554
  • 5
  • 14

I do not have the wherewithal to test using the specific programs mentioned in your example.

However, what you're asking for is possible with the -I (dash capital eye) option to bsub. The only catch is that the job submission message is sent to stdout by default, which will get mixed in with the expected actual output of your program:

Job <123456> is submitted to default queue <normal>.

A solution courtesy this SO answer is:

BSUB_QUIET=1 bsub -I cmd-that-writes-to-stdout | cmd-that-reads-from-stdin

Note that the actual value of the BSUB_QUIET environment variable apparently doesn't matter; it just needs to be defined in the environment.

Hope that helps.