Skip to content

Can't parse output from defaults domains command in macOS #1599

Answered by johnkerl
thesobercoder asked this question in Q&A
Discussion options

You must be logged in to vote

@thesobercoder the output of defaults domains is indeed comma-separated, but, with only one line. In CSV this means the header line, and no data. That in turn means zero records.

There is #314 open to address this.

However, I suspect that CSV-with-header is not what you want here.

You might use mlr --csv --headerless-input (keystroke-saver: mlr -c --hi)

Some examples:

$ defaults domains > dd.txt

$ mlr --icsv --hi --oxtab --from dd.txt clean-whitespace | head
1   .GlobalPreferences_m
2   1812769364
3   Avatar Cache Index
4   Cisco-Systems.Spark
5   ContextStoreAgent
6   LighthouseBitacoraFramework
7   MiniLauncher
8   MobileMeAccounts
9   ScopedBookmarkAgent
10  ZoomChat

$ mlr --inidx --…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by thesobercoder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants