I'm reading the RealName
from dscl
for various users. Depending on the user, the output can be one of the following two:
RealName: <name>
Or:
RealName:
<name>
So I have sed -e 's|^[RealName:[:space:]]*||g' -e '/^$/d'
to get just the <name>
in either case. I'm new to regular expressions, so I'm having trouble merging the two expressions. Any suggestions? (Just doing it for fun. That command works just fine as-is.)