My saviour for this has been python-hostlist: https://www.nsc.liu.se/~kent/python-hostlist/
$ hostlist -e edrcompute-42-[12-14,16] edrcompute-42-12 edrcompute-42-13 edrcompute-42-14 edrcompute-42-16 On Fri, May 6, 2016 at 1:25 PM, Ryan Cox <ryan_...@byu.edu> wrote: > $ scontrol show hostname edrcompute-42-[12-14,16] > edrcompute-42-12 > edrcompute-42-13 > edrcompute-42-14 > edrcompute-42-16 > > > > On 05/06/2016 02:12 PM, Eggleston, Nicholas J. wrote: > > Hey guys, longtime listener first time caller. Due to a bug in a piece of > software we use on our cluster I’m having to write a script do forcefully > deal with some rogue processes. The problem I’m having is that whenever I > call squeue or scontrol show job to get a listing of what jobs are running > on what nodes I get jobs with syntax like edrcompute-42-[12-14,16]. This is > extraordainarly hard to parse, especially when we start adding in nodes > that don’t follow that pattern. I’ve written some regex to try to parse > this, but it’s pretty ugly code and it could all be fixed if I could just > have a command to have sbatch give me the list of full node names and not > this compressed format. I’ve searched and searched the documentation and I > just can’t seem to find any switch to enable that. Help me Obiwan Kenobi, > you’re my only hope! > > > > > > > > -- > > Nick Eggleston > > Missouri S&T > > IT Research Support Services > > > > > -- > Ryan Cox > Operations Director > Fulton Supercomputing Lab > Brigham Young University > >