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


Click here to return to the 'Remove Safari history files on logout via shell script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remove Safari history files on logout via shell script
Authored by: leamanc on Jul 01, '09 05:23:24PM

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.



[ Reply to This | # ]
Remove Safari history files on logout via shell script
Authored by: excarnate on Jul 02, '09 02:11:20PM

In this case it isn't commands, it is the shell. The shell expands the ~ so there is no problem.

~ really isn't that bad, I've never run into problems, but $HOME is slightly preferable, you can change the location of where it looks easily, say:
export HOME=/somewhere/else
say if you have an archived home directory you want it to work with. Maybe not something that applies here. Personally on little scripts that are special purpose I'd use ~ as it is easier and very clear.



[ Reply to This | # ]
Remove Safari history files on logout via shell script
Authored by: RedFred on Jul 06, '09 04:06:54PM

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.



[ Reply to This | # ]