The easiest way to call a OpenAPI/odata query from a shell script is via curl command. However, some aspects need to be considered to make it work.
Syntax curl -u user:password -G -X GET -d 'parameters' 'URL'
Example:
curl -u myuser:mypassword -G -X GET -d '$apply=groupby(ID,%20aggregate(portmfs(im_BitsIn%20with%20percentile95%20as%20im_BitsIn),portmfs(im_BitsOut%20with%20percentile95%20as%20im_BitsOut)))&starttime=1490594251&endtime=1493186251&resolution=RATE&$select=ID,Name&$filter=((substringof(%27CA%27,Name)%20eq%20true))&$format=text/csv' 'http://DA-HOST:8581/odata/api/groups'