I do not see how to use the suffix for the --Format option of thesqueue(1) command. The description does not indicate how to tell the
end of the size and period components and the beginning of the suffix,
but assuming the suffix must being with something other than a period
or numeric character I found all suffix values produce a null separator.
A wanted to use --Format somewhat like --format=%all, producing
all fields. As the --Format did not have an equivalent descriptor,
(ie. something like --Format=All ) it looked like it would be required to list all the
allowed keywords with a suffix of "|", which from the description I
assumed would be as simple as a longer version of something like thi:
squeue --Format='STDOUT:|,STDERR:|,STDIN:|,WorkDir:|'
Given the description:
-O, --Format=<output_format>
Specify the information to be displayed. Also see the -o,
--format=<output_format> option described above (which supports
greater flexibility in formatting, but does not support access
to all fields because we ran out of letters). Requests a comma
separated list of job information to be displayed.
The format of each field is "type[:[.][size][suffix]]"
size Minimum field size. If no size is specified, 20 char‐
acters will be allocated to print the information.
. Indicates the output should be right justified and
size must be specified. By default output is left
justified.
suffix Arbitrary string to append to the end of the field.
Note that many of these type specifications are valid only for jobs
while others are valid only for job steps. Valid type specifications
include:
Even something like this produces no error but the suffix is always a
null string:
squeue --Format='STDOUT:SUFFIX,STDERR:SUFFIXSTDIN:SUFFIXWorkDir:SUFFIX
So if I want to generate output with squeue --Format=FORMAT with a
vertical line character between the output fields what is the proper
syntax?
A test bash(1) script where I could not get the SUFFIX variable to work as expected ...
#!/bin/bash
#@(#) Build value for squeue --Format='FORMAT' that includes all available fields with a vertical bar separating each field
GOODNAMES='' BADNAMES='' SUFFIX='SUFFIX'
GOODNAMES='' BADNAMES='' SUFFIX='1000:|'
GOODNAMES='' BADNAMES='' SUFFIX='|'
for NAME in STDOUT Account AccrueTime admin_comment AllocNodes AllocSID ArrayJobID ArrayTaskID AssocID BatchFlag BatchHost BoardsPerNode BurstBuffer BurstBufferState Cluster ClusterFeature Command Comment Container ContainerID Contiguous Cores CoreSpec CPUFreq cpus-per-task cpus-per-tres Deadline DelayBal Licenses MaxCPUs MaxNodes MCSLabel mem-per-tres MinCpus MinMemory MinTime Mintition PendingTime PreemptTime Prefer Priority PriorityLong Profile QOS Reason Riable SiblingsViableRaw Sockets SPerBoard StartTime State StateCompact STDERR STres-per-node tres-per-socket tres-per-step tres-per-task UserID UserName Wait4Sw
do
if squeue --Format="$NAME" >/dev/null
then
GOODNAMES="$GOODNAMES${NAME}:${SUFFIX},"
else
BADNAMES="$BADNAMES${NAME},"
fi
done 2>&1
#FORMAT=$(tr --squeeze-repeats ' ' ' '<<<$GOODNAMES)
FORMAT=${GOODNAMES%%,} # trim off trailing comma
read r c < <(stty size) # get screen width for use with cut(1)
# try it
squeue --Format="$FORMAT"|column -t|cut -c 1-$c
# echo it
echo "$FORMAT"
exit