Sponsored Content
Top Forums Shell Programming and Scripting Passing a variable to #BSUB -n in a LSF file Post 302547953 by lrayo on Wednesday 17th of August 2011 05:44:29 AM
Old 08-17-2011
Bug

Thanks again.

I do not think I have understood your suggestion properly enough to apply it.

Should I do something like:

>set NPROC = 10
>bsub <<$NPROC < base.lsf

and then in base.lsf just do something like:

Code:
#! /bin/tcsh

#BSUB -n $NPROC

That doesn't even make sense to me. If you could please be more explicit on your suggestion so I can understand it that would be very helpful. 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
apply(1)						      General Commands Manual							  apply(1)

NAME
apply - Applies a command to a set of arguments SYNOPSIS
apply [-acharacter] [-number] command argument... The apply command runs the specified command on each argument in turn. OPTIONS
Identifies the character used instead of the % (percent sign) to designate argument substitution strings. Specifies the number of argu- ments to be passed to command. DESCRIPTION
Normally, arguments are chosen individually; the optional number specifies the number of arguments to be passed to command. If number is 0 (zero), command is run without arguments once for each argument. If you include character sequences of the form %n (where n is a digit from 1 to 9) in command, they are replaced by the nth unused argument following command when command is executed. If any such sequences occur, number is ignored, and the number of arguments passed to command is the maximum value of n in command. You can specify a character other than % (percent sign) to designate argument substitution character strings with the -a option; for exam- ple, -a@ would indicate that the sequences @1 and @2 were to be replaced by the first and second unused arguments following command. NOTES
Shell metacharacters in command may have undesirable effects; it is best to enclose complicated commands in ' ' (single quotes). There is no way to pass a % (percent sign) followed immediately by any number if % is the argument expansion character. EXAMPLES
The following command is similar to ls: apply echo * The following command compares the file a1 to the file b1, a2 to b2, and so on: apply -2 cmp a1 b1 a2 b2 ... The following command runs who 5 times: apply -0 who 1 2 3 4 5 The following command links all files in the current directory to the directory /usr/joe: apply 'ln %1 /usr/joe' * SEE ALSO
Commands: sh(1), xargs(1) apply(1)
All times are GMT -4. The time now is 05:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy