qsub in a bash script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting qsub in a bash script?
# 1  
Old 07-12-2010
qsub in a bash script?

I was just wondering if it is permissible to qsub from a bash script as follows:

Code:
#! /bin/sh

echo "altering .txt in dir $DIR with retokenize.py"
for f in $DIR/txt/*.txt; do
  echo $f;
  /l2/nlp/i2b2/retokenize.py < $f > ${f//.txt/.tok};
done


echo "altering .tok in dir $DIR with awk <s> </s>"
for f in $DIR/txt/*.tok; do
  echo $f;
  cat $f | awk '{printf("<s> %s </s>\n",$0)}' > ${f//.tok/.ecIN};
done


echo "altering .tok in dir $DIR with tagger.stayTOK.py "
for f in $DIR/txt/*.tok; do
  echo $f;
  cat $f | /l2/nlp/i2b2/tagger.stayTOK.py < $f > ${f//.tok/.ecIN-POS};
done


export MODEL=/data/nlp/src/charniak/DATA/DATA_DEV24/;
echo "qsubbing for $DIR";
qsub -o $DIR/ecOUT.log -q kiwi.q /l2/nlp/i2b2/runEC.unconstrained.sh;
qsub -o $DIR/ecOUT-POS.log -q kiwi.q l2/nlp/i2b2/runEC.POS.sh;

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Submit a qsub script SGE

Hello, I'm working on a SGE cluster and trying to echo the variables passed to the qsub command. My script is as follows #!/bin/bash #$ -V #$ -cwd #$ -pe make 10 if ; then echo "Variable is not set" else echo "Variable says: $StatedUserName" fi and I run the... (1 Reply)
Discussion started by: nans
1 Replies

2. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies

3. Shell Programming and Scripting

Qsub + job array + while read; do; done

Linux Server Hi! just some help... I'm using a "Sun Grid Engine" with "qsub" In one hand I have this code while read -r H; do echo ${H}; done < list The number of the lines in the list file is 100. On the other hand I want to create a job array with the option -t echo... (3 Replies)
Discussion started by: echo manolis
3 Replies

4. UNIX for Advanced & Expert Users

Submitting multiple qsub jobs

Hi all, Today, I want to ask how to submit multiple qsub jobs. I want to submit 100 .sh files for the simulations. The name of files is run_001.sh, run_002.sh, run_003.sh, ..... ..... run_100.sh Submitting each file manually are time-consuming, hence, I want to make another .sh file... (11 Replies)
Discussion started by: syg3434
11 Replies

5. UNIX for Dummies Questions & Answers

qsub equivalent of bsub command

"bsub -o /dev/null -P something -q normal -a optimize -n 1 -R \"rusage\ span\\" -J GUISETUP_${PID} \"dc_shell-t -f .dc_script_$job_index.tcl -output_log_file .dc_shell_$job_index.log \"" Can anybody please tell me the qsub equivalent for this command? ---------- Post updated at 06:48 AM... (0 Replies)
Discussion started by: chaudhary3031
0 Replies

6. UNIX for Advanced & Expert Users

Collecting job id from qsub command

Hello. Hopefully this is the right forum, did a search and found some similar questions here. I'm trying to find out if there is a way to get the job id while submitting a job using qsub. I want to monitor the list of active jobs using qstat and when my jobid is no longer on the active list, I... (3 Replies)
Discussion started by: aeoleon88
3 Replies

7. UNIX for Dummies Questions & Answers

Qsub and printf

Hello, I have some issue with qsub and the standard output : I launch a script that "echoes" the string "abc" and then executes a C program in which I print informations with the printf function ; the .o file contains "abc" but not the information displayed by printf. I also tried... (0 Replies)
Discussion started by: Shaderw
0 Replies

8. Shell Programming and Scripting

qsub

Hey all, I have a binary file, named "exe1" that receives a parameter. (I don't have its source code). Executing "exe1" results in creating 3 output files. I have a bash script that runs "exe1". I want to enter "exe1" to cluster queue (using subq command) But i want to do it more than... (1 Reply)
Discussion started by: elad2109
1 Replies

9. UNIX for Advanced & Expert Users

Problem Running qsub multiple jobs

Hello, I have a perl script that takes in one file of input and outputs to a file. I would like to run this script on several input files, and I would like to run it with qsub, something like this: Input files: FileListDssp.txt.numaa FileListDssp.txt.numab FileListDssp.txt.numac etc.. ... (1 Reply)
Discussion started by: InfoSeeker
1 Replies

10. UNIX for Dummies Questions & Answers

qsub and Matlab

I am trying to run a Matlab function, file.m, with qsub. Here is a portion of my .sge file: echo Starting to run Matlab matlab -nojvm -nodesktop -r "file('${inputfile}');exit;" echo finished running Matlab The last two lines of the Matlab function are: disp('finished'); exit So my... (1 Reply)
Discussion started by: laether
1 Replies
Login or Register to Ask a Question
SGE_REQUEST(5)						   Sun Grid Engine File Formats 					    SGE_REQUEST(5)

NAME
sge_request - Sun Grid Engine default request definition file format DESCRIPTION
sge_request reflects the format of the files to define default request profiles. If available, default request files are read and processed during job submission before any submit options embedded in the job script and before any options in the qsub(1) or qsh(1) command-line are considered. Thus, the command-line and embedded script options may overwrite the settings in the default request files (see qsub(1) or qsh(1) for details). There is a cluster global, a user private and a working directory local default request definition file. The working directory local default request file has the highest precedence and is followed by the user private and then the cluster global default request file. Note, that the -clear option to qsub(1) or qsh(1) can be used to discard any previous settings at any time in a default request file, in the embedded script flags or in a qsub(1) or qsh(1) command-line option. The format of the default request definition files is: o The default request files may contain an arbitrary number of lines. Blank lines and lines with a '#' sign in the first column are skipped. o Each line not to be skipped may contain any qsub(1) option as described in the Sun Grid Engine Reference Manual. More than one option per line is allowed. The batch script file and argument options to the batch script are not considered as qsub(1) options and thus are not allowed in a default request file. EXAMPLES
The following is a simple example of a default request definition file: ===================================================== # Default Requests File # request group to be sun4 and a CPU-time of 5hr -l arch=sun4,s_cpu=5:0:0 # don't restart the job in case of system crashes -r n ===================================================== Having defined a default request definition file like this and submitting a job as follows: qsub test.sh would have precisely the same effect as if the job was submitted with: qsub -l arch=sun4,s_cpu=5:0:0 -r n test.sh FILES
<sge_root>/<cell>/common/sge_request global defaults file $HOME/.sge_request user private defaults file $cwd/.sge_request cwd directory defaults file SEE ALSO
sge_intro(1), qsh(1), qsub(1), Sun Grid Engine Installation and Administration Guide COPYRIGHT
See sge_intro(1) for a full statement of rights and permissions. SGE 6.2u5 $Date$ SGE_REQUEST(5)