% Author: Albert Law
% File: qdelall.m
% Description: This will kill all the user queues on a PBS system.
% Note #1: Tested on CLUMEQ and on WESTGRID.
% Note #2: Will destroy any file in the working directory with the name "test1234567890.txt"


filename = 'test1234567890.txt';

system(['qstat | grep ', getenv('USER'), ' > ', filename]);
fid = fopen(filename);

while (feof(fid) ~= 1)
    temp = fgetl(fid);
    system(['qdel ', strtok(temp)]);
end;
