Sponsored Content
Top Forums Shell Programming and Scripting How to define two digits variable in shell script? Post 302962482 by emily on Tuesday 15th of December 2015 04:52:30 AM
Old 12-15-2015
Hello,
Yes, I tried this as following:
Code:
#!/bin/sh

Start=0
Step=9
Entries=1164

mkdir DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/
mkdir DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir$Start
./qsub_seq.csh AnalysisMacro analysisMacro_tmvaEMu.conf /inputfile/location DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir$Start 0 2


However, It failed to work. The output was as following:
Code:
DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0
DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_0: No such file or directory.
./qsub.sh: line 5: DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_0.zsh: No such file or directory
rm: cannot remove `DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_0.out': No such file or directory
chmod: cannot access `DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_0.zsh': No such file or directory
Unable to read script file because of error: error opening DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_0.zsh: No such file or directory
DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_1: No such file or directory.
./qsub.sh: line 5: DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_1.zsh: No such file or directory
rm: cannot remove `DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_1.out': No such file or directory
chmod: cannot access `DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_1.zsh': No such file or directory
Unable to read script file because of error: error opening DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_1.zsh: No such file or directory
DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_2: No such file or directory.
./qsub.sh: line 5: DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_2.zsh: No such file or directory
rm: cannot remove `DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_2.out': No such file or directory
chmod: cannot access `DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_2.zsh': No such file or directory
Unable to read script file because of error: error opening DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/Subdir0_analysisMacro_tmvaEMu.conf_2.zsh: No such file or directory

Probably, I need to look for better solution of executing this script.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using Grep to Define a Variable

I am using korn shell unix. I have a script that I am working with to do a check for me using a text file. #finds "Time" from the text file and cuts the second field from the #line A= grep Time test.txt | cut -f2 # the "#Missing" is being pulled from the second field of the text... (1 Reply)
Discussion started by: cspcspcsp
1 Replies

2. UNIX for Dummies Questions & Answers

define length of variable

I have a variable with a value of "05". When I add one to that variable, using the command: CURR_YY=`expr $CURR_YY + 1`, I get the value of "6", losing the leading zero (which is needed for passing to another script). How do I keep the leading zero? Thank you! (10 Replies)
Discussion started by: cbarker
10 Replies

3. Shell Programming and Scripting

How to define a variable with variable definition is stored in a variable?

Hi all, I have a variable say var1 (output from somewhere, which I can't change)which store something like this: echo $var1 name=fred age=25 address="123 abc" password=pass1234 how can I make the variable $name, $age, $address and $password contain the info? I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies

4. Shell Programming and Scripting

bash - define a variable

Hello, I would like to define a variable based on another variable: a=5 b$a=100 This does not work. What is the right way to do it? Thanks ---------- Post updated at 07:37 PM ---------- Previous update was at 07:33 PM ---------- Found my answer with the search function (did not... (0 Replies)
Discussion started by: jolecanard
0 Replies

5. Shell Programming and Scripting

Get the places of binary digits in the korn shell script

TO THE ALMIGHTY FORUM , though i have already posted the same question on hex to binary thread , i am posting here also for other beginners who may benefit from this thread... I have a 32 bit binary containing a series of 1' and 0's , and i am stuck... (2 Replies)
Discussion started by: venu
2 Replies

6. Shell Programming and Scripting

question about define variable.

Hi, Unix Gurus, In our existing file, there is a script like #!/bin/sh step=${1:-0} cur_step=10 if ... My question is what's "${1:-0}" mean? I know it defines a variable but I don't know what's (1:-0) mean? :wall: Thanks in advance. (2 Replies)
Discussion started by: ken002
2 Replies

7. Shell Programming and Scripting

Define variable from file.

HI I have file A.txt _1A _2A _3A _4A I want define all as different variable. $1A=_1A $2B=_2A $3C=_3A $4D=_4A Now i can use any variable in my script. (3 Replies)
Discussion started by: pareshkp
3 Replies

8. Shell Programming and Scripting

How to define a variable in a BASH script by using a JSON file online?

Hello, I would like to modify an existing script of mine that uses a manually defined "MCVERSION" variable and make it define that variable instead based on this JSON file stored online: https://s3.amazonaws.com/Minecraft.Download/versions/versions.json Within that JSON, I 'm looking for... (4 Replies)
Discussion started by: nbsparks
4 Replies

9. UNIX for Beginners Questions & Answers

sed / awk script to delete the two digits from first 3 digits

Hi All , I am having an input file as stated below 5728 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r03_q_reg_20_/Q 011 611 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r04_q_reg_20_/Q 011 3486... (4 Replies)
Discussion started by: kshitij
4 Replies
fizsh(1)							       fizsh								  fizsh(1)

NAME
fizsh - friendly interactive zshell. SYNOPSIS
fizsh [OPTIONS]... [ARGUMENTS]... DESCRIPTION
Fizsh is a front end to zsh. Fizsh provides zsh with interactive syntax-highlighting and a MATLAB-like history-search. Fizsh is intended to look and feel similar to fish. A distinguishing feature is that fizsh can handle Bourne compatible syntax. This is because fizsh is a front end to zsh. Fish uses its own syntax. CONFIGURATION
$HOME/.fizsh is the directory where fizsh keeps its configuration files. The file $HOME/.fizsh/.fizshrc serves as the user's local startup script. Local customizations, such as aliases and functions, can be added here. $HOME/.fizsh/.fizshrc allows the same syntax as $HOME/.zshrc under zsh. $HOME/.fizsh/.fizsh_history is default name of fizsh's history file. The other files in $HOME/.fizsh are installed by /usr/bin/fizsh. In order to reinstall these files use: /usr/bin/fizsh -r or /usr/bin/fizsh --reinstall. Compared to the default configuration of zsh, fizsh additionally sets the options "histignorealldups", "histignorespace", "histreduceblanks", "incappendhistory", "interactivecomments", "promptsubst", "correct" and "nobeep". For further configuration details consult zsh's man pages. INVOCATION
Fizsh is meant to be invoked without options and without command-line arguments. The only supported command-line options are "--version", "--help", "--login", "--reinstall", "-v", "-h", "-l" and "-r". "--version" or "-v" yields fizsh's version number. "--help" or "-h" causes fizsh to print brief usage information. "--login" or "-l" cause fizsh to be a login shell. "--reinstall" or "-r" will reinstall some of fizsh's configuration files (see above). If invoked with other command-line options and/or arguments fizsh will silently revert to zsh. BUGS
There are no known bugs at the moment. Bug reports, bug fixes and other comments are welcome. NOTES
MATLAB is a registered trademark of The MathWorks, Inc. AUTHOR
Written by Guido van Steen, based on work by the "zsh-syntax-highlighting contributors" and the contributors to "zsh-history-substring- search". SEE ALSO
zsh(1) fish(1) Version 1.0.2 9 Aug 2011 fizsh(1)
All times are GMT -4. The time now is 05:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy