#!/usr/bin/env zsh mmcli -m any --location-get | # get location from modem manager grep "long\|lat\|alt" | # select only relevant lines cut -d':' -f2 | # remove colons, cut -d' ' -f2 | # and leading spaces tr '\n' ',' | # csv-esque cut -d',' -f1-3 # remove unwanted newline