Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Cleaner display for 'defaults domains' command' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Cleaner display for 'defaults domains' command
Authored by: jzsimon on Apr 28, '03 11:22:34AM
> This still leaves some lines beginning with spaces, but I haven't yet figured out how to remove those, too.

Try this:
defaults domains | sed 's/, /\
/g' | more

It uses sed to change all combinations of 'comma space' to a newline. It works because the first line ends in \, which is an escape of the next character which is an escaped newline.

[ Reply to This | # ]

Cleaner display for 'defaults domains' command
Authored by: rtl on Apr 28, '03 11:30:11AM
Another way: defaults domains | tr -d ' ' | tr ',' '\n' | more

[ Reply to This | # ]
Cleaner display for 'defaults domains' command
Authored by: jzsimon on Apr 29, '03 11:19:33AM

My code changed between its preview and its posting. The end of
the line beginning with "default" should end in two backslashes,
not one. Same for the final sentence which should read: ... line
ends in backslash backslash, which is an escaped...



[ Reply to This | # ]