Changing the names isn't an option; I inherited these names years ago and nobody's going to want me to change them because I want to see something in order. :)

Basically, I can run this command to see it the way I want it:
    qhost | head -n 3; qhost | tail -n +4 | sort -V
but of course this is cumbersome and makes adding options a chore. (Suppose I want to use -j?)

I guess XML it is. If this were PowerShell it'd be a cinch, but working in Bash... ugh...

On 8/1/2019 10:39 AM, MacMullan IV, Hugh wrote:

Best for qhost sort would be to change your 'cluster' names to zero-padded, if 
you really want that kind of sorting. Or you could create an alias like 'qhost 
| sort -nk 1.8', assuming 'clusterX' is always true (the 8th character is where 
you start the sort).

As Skylar says, if you want a custom qstat, you should probably build one from 
the '-xml' output.


-----Original Message-----
From: <> On Behalf Of 
David Trimboli
Sent: Thursday, August 1, 2019 9:59 AM
To: users Users <>
Subject: [gridengine users] Sorting qhost and choosing qstat columns

When I run qhost, the output is sorted alphabetically — which means
"cluster10" appears before "cluster2," and so on.

Before I go writing bash functions to manually sort this, which might
lead to output side-effects, is there any way to change the sort to a
natural number sort, so that "cluster2" would appear before "cluster10,"

When I run qstat, the normal wraps to a second line in my terminal set
to 120 columns. I could fix that by eliminating the "jclass" column,
which doesn't contain any information, but I can only find ways to add
columns, not take them away. Is there a way to make this column go away?

users mailing list
users mailing list

Reply via email to