#!/bin/bash WORKGROUPS="$(sacctmgr --noheader --parsable list account | awk -F\| '{print $1;}')" for WORKGROUP in ${WORKGROUPS}; do WORKGROUP_NODELIST="$( grep $WORKGROUP partitions.conf | awk ' BEGIN { nodelist=""; } /PartitionName=/ { for ( i=1; i <= NF; i++ ) { if ( match($i, "^Nodes=(.*)", pieces) > 0 ) { if ( nodelist ) { nodelist = nodelist "," pieces[1]; } else { nodelist = pieces[1]; } break; } } } END { printf("%s\n", nodelist); } ' | snodelist --nodelist=- --unique --compress )" if [ -n "$WORKGROUP_NODELIST" ]; then cat <