I'm having a little bit of an issue here.
Here's the situation: We will be deploying a new application soon, and the server configuration resides in a simple XML file, located somewhere deep in the ~/library/Preferences
. I want to create a bash/shell script that will basically copy the XML file at the right place, but for every user folder that exists.
I was able to use the below script for Windows, but I'm wondering if there is something similar for Apple.
Here's the Windows script:
$sourceLocation = "C:\Users\suptech\Downloads\TEMP"
$targetLocation = "C:\Users"
$result = @()
$result += get-ChildItem $targetLocation | Where-Object {$_.PSIsContainer}
$result | foreach-Object { copy-item $sourceLocation -Destination "C:\Users\$_\AppData\Roaming\TEST” -Recurse -Force}
Could someone help me ?
Thanks in advance! 🙂
Best Answer
Well, here's something that you can work with. It isn't tested in a real world environment and is offered AS IS- without any warranty.
Another solution based on bmike's suggestion