Sponsored Content
Top Forums Shell Programming and Scripting Passing a variable to #BSUB -n in a LSF file Post 302547406 by lrayo on Monday 15th of August 2011 02:01:30 PM
Old 08-15-2011
Bug Passing a variable to #BSUB -n in a LSF file

Hi There!

I'm writing this LSF script to make it easier to send jobs to a cluster when varying certain parameters. At one point I'd like to do something like:

set NPROC = 10

and later on call BSUB using something like:

#BSUB -n $NPROC

unfortunately for me, this throws an error:

Bad argument for option -n. Job not submitted.

Anyone with an idea on how to pass BSUB a variable? With this example it sounds sort of roundabout, but sometimes you want to do some arithmetic with $NPROC before passing it to #BSUB and then being able to do it this way may be something very useful.

Thanks!Smilie

---------- Post updated at 06:01 PM ---------- Previous update was at 05:57 PM ----------

Sorry, I read the post back and I wanted to make sure the problem is clear, this works straight away:

#BSUB -n 10

This doesn't work

set NPROC = 10
#BSUB -n $NPROC

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

passing unix variable to sqlplus without a file name

Hi, I want to input unix variable to sqlplus.The following is working fine sqlplus username/password @dummy.sql param1 param2 << EOF create user $1 identified by $2; EOF But I dont want any file name to be passed,I just want to pass the parameter. Is there any way to that?? Thanks... (3 Replies)
Discussion started by: sakthi.abdullah
3 Replies

2. Shell Programming and Scripting

Passing output to variable instead of file

Hi, In normal shell scripting, how do you pass the output of a command to a variable, instead of a file and be able to use it later? The code is: #!/bin/bash who | cut -d" " -f1 > onlineusers Instead of passing the output of the above command to the file called 'onlineusers'... (1 Reply)
Discussion started by: Furqan_79
1 Replies

3. Shell Programming and Scripting

passing variable to another file and replacing

Hi all, I have a script in file1 which gets input from the user say variable "TYPE". This variable is present in the other file2. I want to replace the variable in the file2 with the value given by the user and print the file. How can I achieve this task? file1 code echo "Give... (3 Replies)
Discussion started by: Ananthdoss
3 Replies

4. Shell Programming and Scripting

passing file extension using external variable

Hi, How can I modify the FILETYPE command ? I want to provide the file extension, like txt, root .? Thanks, #!/bin/bash FROM=$1 TO=$2 FILETYPE=$3 ... (4 Replies)
Discussion started by: nrjrasaxena
4 Replies

5. Programming

PASSING PART OF FILE CONTENT TO VARIABLE

All, I have a log file containing lots of data now i want to extract all text between block below(names) without the title or end pattern but only names, ++++START++++ SCOTT TIGER HENRY PAUL JARED OTIENO OMOLLO JA NIGERIA ++++END++++ the names i want to return and store in a variable in... (1 Reply)
Discussion started by: Scott2000
1 Replies

6. Shell Programming and Scripting

Passing variable as a file-Scripting Help

Hi Guys, i have a file where data is in the below format:: data1 data2 data3 data4 data4 data6 my script written as:: #!/bin/ksh cd $1 at now <<END sh $2 END Here i want to pass the values stored in the above file one by one till the end of line. Here if i am doing it as:: (2 Replies)
Discussion started by: Atp3530
2 Replies

7. Shell Programming and Scripting

Passing variable from file to Oracle

cat a1 scott robert tom test script : #!/usr/bin/ksh for NAME in `cat a1` do VALUE=`sqlplus -silent "nobody/bobody01@testq" <<END set pagesize 0 feedback off verify off heading off echo off select username from dba_users where username=upper('$NAME'); END` if ; then echo... (3 Replies)
Discussion started by: jhonnyrip
3 Replies

8. Shell Programming and Scripting

Passing Shell variable from file to another command

Hi all, I have a file looks like AAAA 111 BBBB 222 CCCC 333 need to pass variable value like var1=AAAA and var2=111 to another command for three times with next values. stuck over here cat file | while read line do export var1=`awk '{print $1}'` echo $var1 export var2=`cat file... (3 Replies)
Discussion started by: rakeshtomar82
3 Replies

9. Shell Programming and Scripting

How to create a variable without multiple concats in a perl scripts that makes a bsub?

The red text at the bottom represents the three lines I want to address. I'm dynamically creating a bsub with a perl script and would like to create the fasta_16S variable in a single line....not three. I'm having difficulty in getting the syntax correct. Obviously, there is some confusion... (3 Replies)
Discussion started by: jdilts
3 Replies

10. UNIX for Beginners Questions & Answers

Passing a file name to a variable

Below is the command mv AP_FLEXCUBE_INTERFACE10.txt FTPYMNTE_`date "+%Y%m%d%H%M%S" | tr '' ''`.TXT it is changing the file name to a different name according to time stamp dynamically. I want to capture that dynamic file name present in the directory to a variable . After that i want to... (6 Replies)
Discussion started by: sujit das
6 Replies
DH_INSTALLINIT(1)						     Debhelper							 DH_INSTALLINIT(1)

NAME
dh_installinit - install init scripts and/or upstart jobs into package build directories SYNOPSIS
dh_installinit [debhelperoptions] [--name=name] [-n] [-R] [-r] [-d] [--params] DESCRIPTION
dh_installinit is a debhelper program that is responsible for installing init scripts with associated defaults files, as well as upstart job files into package build directories. It also automatically generates the postinst and postrm and prerm commands needed to set up the symlinks in /etc/rc*.d/ to start and stop the init scripts. FILES
debian/package.init If this exists, it is installed into etc/init.d/package in the package build directory. debian/package.default If this exists, it is installed into etc/default/package in the package build directory. debian/package.upstart If this exists, it is installed into etc/init/package.conf in the package build directory. OPTIONS
-n, --noscripts Do not modify postinst/postrm/prerm scripts. -o, --onlyscripts Only modify postinst/postrm/prerm scripts, do not actually install any init script, default files, or upstart job. May be useful if the init script or upstart job is shipped and/or installed by upstream in a way that doesn't make it easy to let dh_installinit find it. -R, --restart-after-upgrade Do not stop the init script until after the package upgrade has been completed. This is different than the default behavior, which stops the script in the prerm, and starts it again in the postinst. This can be useful for daemons that should not have a possibly long downtime during upgrade. But you should make sure that the daemon will not get confused by the package being upgraded while it's running before using this option. -r, --no-restart-on-upgrade Do not stop init script on upgrade. --no-start Do not start the init script on install or upgrade, or stop it on removal. Only call update-rc.d. Useful for rcS scripts. -d, --remove-d Remove trailing d from the name of the package, and use the result for the filename the upstart job file is installed as in etc/init/ , and for the filename the init script is installed as in etc/init.d and the default file is installed as in etc/default/ . This may be useful for daemons with names ending in d. (Note: this takes precedence over the --init-script parameter described below.) -uparams --update-rcd-params=params -- params Pass params to update-rc.d(8). If not specified, defaults will be passed to update-rc.d(8). --name=name Install the init script (and default file) as well as upstart job file using the filename name instead of the default filename, which is the package name. When this parameter is used, dh_installinit looks for and installs files named debian/package.name.init, debian/package.name.default and debian/package.name.upstart instead of the usual debian/package.init, debian/package.default and debian/package.upstart. --init-script=scriptname Use scriptname as the filename the init script is installed as in etc/init.d/ (and also use it as the filename for the defaults file, if it is installed). If you use this parameter, dh_installinit will look to see if a file in the debian/ directory exists that looks like package.scriptname and if so will install it as the init script in preference to the files it normally installs. This parameter is deprecated, use the --name parameter instead. This parameter is incompatible with the use of upstart jobs. --error-handler=function Call the named shell function if running the init script fails. The function should be provided in the prerm and postinst scripts, before the #DEBHELPER# token. NOTES
Note that this command is not idempotent. dh_prep(1) should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHORS
Joey Hess <joeyh@debian.org> Steve Langasek <steve.langasek@canonical.com> 9.20120909 2012-04-10 DH_INSTALLINIT(1)
All times are GMT -4. The time now is 06:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy