|
|
Remove Safari history files on logout via shell script
The problem with using ~ to denote your home folder is that it's just bad practice, in terms of portability. It won't work on all shell scripts in all environments. Sure, in this case, you're only going to be running it on OS X, and it will probably work all the time. But it's best to stick to the rules of scripting, and using the tilde, or other path shortcuts, is not recommended. But, there is something you can use instead: the
Remove Safari history files on logout via shell script
Looking into this further, the tilde might not even work, according to this archived OS X Hints forum post. It says: Commands don't understand tilde, only the shell.
Remove Safari history files on logout via shell script
In this case it isn't commands, it is the shell. The shell expands the ~ so there is no problem.
Remove Safari history files on logout via shell script
The Logout hook is run as root so ~ and $HOME refer to /private/var/root, not the home directory of the user logging out. See the hint below for the correct way to do this. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks 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.07 seconds |
|