#!/bin/bash -l # Give job a name #$ -N main_job # Join output and error streams #$ -j y # Start a few tasks #$ -t 1-3 # Define output file name based on the taskID output="output_${SGE_TASK_ID}.txt" # Execute some code. # In this examples each task generates an output file # that contains # 1. Task ID echo $SGE_TASK_ID > $output # 2. the date and time of execution date >> $output # 3. Which host my job executed on echo $HOSTNAME >> $output echo "--------------------------" >> $output