#!/bin/bash -l # Give job a name #$ -N last_job # Join output and error files: #$ -j y #$ -o logs # This job will depend on jobs with name main_job # and will start to execute only when all the jobs with this name are done #$ -hold_jid main_job cat output_*.txt > all.txt #rm output_*.txt