|
|
Track changes made with the defaults command
It might be more efficient and update-proof to run this "history" command periodically instead of this intercept method. In fact, your situation is exactly what the "history" utility is for. So long as your "defaults" instructions were in the last five hundred shell commands, running: history | grep "defaults" will show what you've recently done with the "defaults" command.
---
Track changes made with the defaults command
Interesting idea, because then you could log other specific commands as well, such as
I just tried it now and there were no default entries in my past 500, so with this approach you'd probably want to run the scan relatively frequently and possible deal with duplicates.
One problem with this and a problem in general with my log function is that it can't really take the output of a command with multiple lines and log it "correctly". I have to do something like
Suggestions on a better log function that could handle multiple lines but still keep the same prefix (date, user, function?)
Track changes made with the defaults command
An improvement on the log function and an answer to my own question about logging multi-line output
For the log function, I indent with shell levels so you can see in the log when scripts call other scripts; also, because $0 is often "-bash" and the dash is interpreted as an option, I strip a leading dash from the name of the calling function.
And secondly, a way to put multiple lines into the log (duh):
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.12 seconds |
|