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


Click here to return to the 'Solve quoting problem once and for all' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Solve quoting problem once and for all
Authored by: greed on Nov 18, '04 03:59:24PM

Aha! We're going off on a tangent with this quoting problem.

The problem is, defaults handles lots of different types, and it is guessing the type from your input. Sufficently complex input (containing ", {, }, [, or ], that I've found so far) give it fits.

So we just tell it the argument is a string and all is well!


/usr/bin/defaults write \
 /Library/Preferences/com.apple.loginwindow \
 LoginwindowText \
 -string "$(/sw/bin/fortune)"

(The trailing backslashes serve to continue the command onto multiple lines.)

And, of course, add the -n 80 -s /sw/share/fortunes flags to taste. I personally hate the Zippy the Pinhead quotes, but like the offensive file.

[ Reply to This | # ]

Solve quoting problem once and for all
Authored by: slowco on Nov 19, '04 10:37:29AM

A good solution, thanks. I forgot about the -string parameter. God job!



[ Reply to This | # ]