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