Using Mac Yosemite 10.10.3
I have Jenkins installed on my mac which integrates with other applications and there is an important folder to which access should be present for all jenkins users. This can be achieved by adding them to its 'User and Group', and give them read, write access(Right click a folder/Get info/Sharing and permissions on bottom/that '+' symbol).
My question in short : To cut short, jenkins users should have access to that folder and should be present in 'User and Group' of that folder(Just as shown in the image below).
The above permission was given manually and I want to do that using a script which can be stored and invoked when needed.
(Am novice to shell scripting and to mac).
If only the jenkins user need to access this folder with a R/W access, you can use the following commands:
Update from June 16th 2015
This is a second solution to create a group build_users, add the jenkins user to this group and update the folder permissions.