#!/bin/bash userN=`whoami`; R=`qstat qwork@ms | grep $userN | grep R | wc -l`; Q=`qstat qwork@ms | grep $userN | grep Q | wc -l`; if [ "$1" != "" ] then qstat qwork@ms | grep $userN | grep R echo "R: $R, Q: $Q" fi let Total=$R+$Q echo $Total