Find only one value via shell script

0

Galera,

I am creating a script to fetch a value, however, within BDD there are repeated values and I would like to fetch only one of each. For example, there are several drives for each state, but I want to fetch only the main drive. They are 28 main units and 720 secondary units. The 720 secondary units have as their "parent unit" one of the 28 main units.

For example, São Paulo state has 150 units, but only one is the main one and consequently becomes the parent unit of the other 149 units.

Anyway, every time I perform a unit search it returns all of them to me, but I just want the main units to return to me. Their id goes from 1 to 28.

The search is performed via rest, through the shell script.

    
asked by anonymous 28.06.2017 / 21:05

0 answers