Using Scripts to Run Analysis

How do I write scripts?

Where can I find output files for scripts that die while running? (DUKE SPECIFIC!)

On the new cluster, hugin, your home directory is shared with the nodes, which means that your output scripts will always be on your home directory! You can read them with nedit. If you need to look at an output log while a script is still running, use the commands “more”,”less”,”tail -f” to view your logs or else there will probably be issues with the script’s logging abilities.

Where do I save and run scripts from?

-l hostname=node#

Useful Commands

chmod u+x filename
# is what you type when a script is done to make it executable

# shows the permissions for a script

# allows you to name your job.  So if we want to run -qsub but also name the job, we would run qsub -N my_script_run

# allows you to check the status of your jobs, or 

# to see all jobs

rm -rf NAME 
# is how you delete a file.  Be very careful with this one!

# followed by the job number (use qstat to get job numbers) will stop a job from running, and delete it.

On Windows, you should use xemacs (or similar) over word or notepad! Generally you shouldn’t open scripts that are to be run in a unix environment on a windows machine, because you are likely to add carriage returns or non unix characters that will make your scripts not function in the unix environment. See Get Rid of Carriage Returns Using TR if you accidentally do this!

Script Examples

General Scripting