Sponsored Content
Full Discussion: Trouble looping commands
Top Forums UNIX for Beginners Questions & Answers Trouble looping commands Post 303019348 by tim.morris on Wednesday 27th of June 2018 10:48:06 AM
Old 06-27-2018
Trouble looping commands

Hi,

I have encountered a problem that I am unable to find a workaround for. I have 52 numbers and I need to submit an individual job for each pair combination, so too many to do by hand.

I have created a submission file (submission_code.sh) which contains the following code:

Code:
gcta64 --reml-bivar $a $b --out out_$a_$b; sleep 1

And I have created a loop file which contains the following code:

Code:
for a in `seq 1 52`
 do
  for b in `seq 1 52`
   do
  echo $a $b
  bash submission_code.sh
 sleep 1
done
done

The code runs, but it does not pass over the sequence numbers from the loop file to the submission file. Instead for "a" and "b" that values used are 1 and 2, which are the default used by the programme.

Can anyone help with this?

Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 06-27-2018 at 04:00 PM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. Programming

code that reads commands from the standard i/p and executes the commands

Hello all, i've written a small piece of code that will read commands from standard input and executes the commands. Its working fine and is execting the commands well. Accepting arguments too. e.g #mkdir <name of the directory> The problem is that its not letting me change the directory i.e... (4 Replies)
Discussion started by: Phrozen Smoke
4 Replies

2. Shell Programming and Scripting

help with looping

vesselNames values: xxx yyy zzz vesselPlanned values: xxx zzz zzz zzz OIFS="" OIFS=$IFS IFS="\n" (2 Replies)
Discussion started by: finalight
2 Replies

3. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

4. AIX

HACMP: difference between 'cl' commands and 'cli' commands

Hi all, I'm new in this forum. I'm looking for the difference between the HACMP commands with the prefix "cl" and "cli". The first type are under /usr/es/sbin/cluster/sbin directory and the second are under /usr/es/sbin/cluster/cspoc directory. I know that the first are called HACMP for AIX... (0 Replies)
Discussion started by: peppix
0 Replies

5. Shell Programming and Scripting

trouble looping in script

I am having problem looping this script I want to give the user option to decide if they want to continue after each entry but then also loop it back to beginning so they can more to content of there testcase they just created. I fam new to scripting so loops are little tricky for me. code I... (7 Replies)
Discussion started by: andrew.p.mcderm
7 Replies

6. Shell Programming and Scripting

Trouble executing piped shell commands in perl code

I am trying to execute a piped combination of shell commands inside a perl program. However, it is not working as desired. This is my program, i am trying to print only filenames from the output of ls -l $ cat list_test #!/usr/bin/perl -w use strict; my $count=0; my @list=`ls -l|awk... (4 Replies)
Discussion started by: sam05121988
4 Replies

7. UNIX for Dummies Questions & Answers

Ps commands trouble

Hi, i am writing a bash file and need to list the command name and user for the busiest process ie the one using the greatest percentage of CPU time) im kind of stuck. i know you should get the highest CPU , sort column 3 then take off the head but i'm un sure how would i do that? echo... (2 Replies)
Discussion started by: ryoukii
2 Replies

8. Shell Programming and Scripting

Trouble passing commands with expect

Hello All, I hope someone could help me with this. I'm creating a shell script to run a process. The trouble is, part of the process has to be ran as a different user. I can 'su' to the user ok, but I'm having trouble passing a 'cd' command as well as some variables I set earlier in the... (1 Reply)
Discussion started by: bbbngowc
1 Replies

9. Shell Programming and Scripting

Trouble using awk and sed commands

Hi i have a control file which i need to read. It is ',' separated. the 3rd parameter will be ';' separated. I have 2 files: /home/orig.txt /home/join.txt I need a O/P file name based on firstparameter_1.txt and it should have the content of /home/orig.txt and appended content from... (2 Replies)
Discussion started by: Ravindra Swan
2 Replies

10. Shell Programming and Scripting

Looping

Hey guys, so I am trying to do a loop script that will go through each folder (no gui so just each domain has a folder) and grab out the databases being used on that domain. I know I would use mysql -e "show databases where not 'information_schema';" once in each directory to pull the actual... (3 Replies)
Discussion started by: dough
3 Replies
GLOBUS-JOB-SUBMIT(1)						  GRAM5 Commands					      GLOBUS-JOB-SUBMIT(1)

NAME
globus-job-submit - Submit a batch job using GRAM SYNOPSIS
globus-job-submit [-dumprsl] [-dryrun] [-verify] [-file ARGUMENT_FILE] SERVICE_CONTACT [-np PROCESSES | -count PROCESSES] [-m MAX_TIME | -maxtime MAX_TIME] [-p PROJECT | -project PROJECT] [-q QUEUE | -queue QUEUE] [-d DIRECTORY | -directory DIRECTORY] [-env NAME=VALUE]... [-stdin [-l | -s] STDIN_FILE] [-stdout [-l | -s] STDOUT_FILE] [-stderr [-l | -s] STDERR_FILE] [-x RSL_CLAUSE] [-l | -s] EXECUTABLE [ARGUMENT...] globus-job-submit [-help] [-usage] [-version] [-versions] DESCRIPTION
The globus-job-submit program constructs a job description from its command-line options and then submits the job to the GRAM service running at SERVICE_CONTACT. The executable and arguments to the executable are provided on the command-line after all other options. Note that the -dumprsl, -dryrun, -verify, and -file command-line options must occur before the first non-option argument, the SERVICE_CONTACT. The globus-job-submit provides similar functionality to globusrun in that it allows batch submission of GRAM jobs. However, unlike globusrun, it uses command-line parameters to define the job instead of RSL expressions. To retrieve the output and error streams of the job, use the program globus-job-get-output. To reclaim resources used by the job by deleting cached files and job state, use the program globus-job-clean. To cancel a batch job submitted by globus-job-submit, use the program globus-job-cancel. OPTIONS
The full set of options to globus-job-submit are: -help, -usage Display a help message to standard error and exit. -version Display the software version of the globus-job-submit program to standard output. -versions Display the software version of the globus-job-submit program including DiRT information to standard output. -dumprsl Translate the command-line options to globus-job-submit into an RSL expression that can be used with tools such as globusrun. -dryrun Submit the job request to the GRAM service with the dryrun option enabled. When this option is used, the GRAM service prepares to execute the job but stops before submitting the job to the LRM. This can be used to diagnose some problems such as missing files. -verify Submit the job request to the GRAM service with the dryrun option enabled and then without it enabled if the dryrun is successful. -file ARGUMENT_FILE Read additional command-line options from ARGUMENT_FILE. -np PROCESSES, -count PROCESSES Start PROCESSES instances of the executable as a single job. -m MAX_TIME, -maxtime MAX_TIME Schedule the job to run for a maximum of MAX_TIME minutes. -p PROJECT, -project PROJECT Request that the job use the allocation PROJECT when submitting the job to the LRM. -q QUEUE, -queue QUEUE Request that the job be submitted to the LRM using the named QUEUE. -d DIRECTORY, -directory DIRECTORY Run the job in the directory named by DIRECTORY. Input and output files will be interpreted relative to this directory. This directory must exist on the file system on the LRM-managed resource. If not specified, the job will run in the home directory of the user the job is running as. -env NAME=VALUE Define an environment variable named by NAME with the value VALUE in the job environment. This option may be specified multiple times to define multiple environment variables. -stdin [-l | -s] STDIN_FILE Use the file named by STDIN_FILE as the standard input of the job. If the -l option is specified, then this file is interpreted to be on a file system local to the LRM. If the -s option is specified, then this file is interpreted to be on the file system where globus-job-submit is being executed, and the file will be staged via GASS. If neither is specified, the local behavior is assumed. -stdout [-l | -s] STDOUT_FILE Use the file named by STDOUT_FILE as the destination for the standard output of the job. If the -l option is specified, then this file is interpreted to be on a file system local to the LRM. If the -s option is specified, then this file is interpreted to be on the file system where globus-job-submit is being executed, and the file will be staged via GASS. If neither is specified, the local behavior is assumed. -stderr [-l | -s] STDERR_FILE Use the file named by STDERR_FILE as the destination for the standard error of the job. If the -l option is specified, then this file is interpreted to be on a file system local to the LRM. If the -s option is specified, then this file is interpreted to be on the file system where globus-job-submit is being executed, and the file will be staged via GASS. If neither is specified, the local behavior is assumed. -x RSL_CLAUSE Add a set of custom RSL attributes described by RSL_CLAUSE to the job description. The clause must be an RSL conjunction and may contain one or more attributes. This can be used to include attributes which can not be defined by other command-line options of globus-job-submit. -l When included outside the context of -stdin, -stdout, or -stderr command-line options, -l option alters the interpretation of the executable path. If the -l option is specified, then the executable is interpreted to be on a file system local to the LRM. -s When included outside the context of -stdin, -stdout, or -stderr command-line options, -l option alters the interpretation of the executable path. If the -s option is specified, then the executable is interpreted to be on the file system where globus-job-run is being executed, and the file will be staged via GASS. If neither is specified, the local behavior is assumed. ENVIRONMENT
If the following variables affect the execution of globus-job-submit. X509_USER_PROXY Path to proxy credential. X509_CERT_DIR Path to trusted certificate directory. SEE ALSO
globusrun(1), globus-job-run(1), globus-job-clean(1), globus-job-get-output(1), globus-job-cancel(1) University of Chicago 03/18/2010 GLOBUS-JOB-SUBMIT(1)
All times are GMT -4. The time now is 05:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy