In the following example script, I’m going to pull a list of just the usernames from fdesetup.
sudo fdesetup list
The output would be as follows:
charlesedge,F4D8B61D-1234-1234-98F4-103470EE1234
emerald,2E1203EA-1234-4E0D-1234-717D27221234
admin,50058FCF-88DF-1234-1234-91FCF28C0488
I’ll then pipe them into sed and use the , as a delimiter, pulling * or everything before it:
sudo fdesetup list | sed 's;,.*;;'
As follows:
charlesedge
emerald
admin