I am trying to replace the default home page for several mac user accounts, I wrote a script that will hunt the files down and replace them with a pre-configured set. The problem I am having is that the download destination path for the browser is hard coded into a .plist (text config file) file along with the homepage. The issue is that if I replace this file with a pre-configured version the homepage is changed successfully but the download location is then wrong and the browser won't be able to download anything.
the download path originally is something like /Users/rob/Desktop
the altered one is something like /Users/sample/Desktop
Because the /Users/sample/Desktop doesn't match the user I am replacing files for, there is a problem.
So I would like to set the location in the pre-configured file to something like /Users/[PATTERN//PATTERN]/Desktop and have the script open the text file, look for the pattern and replace it with the value of a variable called $USER_NAME which I already have holding the proper user name earlier in the script.
How can I have the script look inside the .plist file, find the pattern and replace it with a variable value?
I actually JUST tried this as a guess and it worked. Can you tell me what difference there is between the single quotes and double quotes that fixes this?