-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_file.pl
More file actions
executable file
·30 lines (24 loc) · 996 Bytes
/
deploy_file.pl
File metadata and controls
executable file
·30 lines (24 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl
###################################################################
#$root = "/Users/gersteina1/Desktop/sandbox/users";
#$prefs ='';
$root = "/Users"; # where to find the User directories
$prefs = "/Library/Preferences";
`cd $root`;
# move into the root directory (defined above)
$homes=`ls $root | grep -v -x "Shared" | grep -v -x "flamacadmin" | grep -v -x "acc" | grep -v -x ".localized"`;
# list the folders found in $root that aren't Shared, flamacadmin, acc, and put them into an array (@homes)
@homes=split('\n', $homes);
# take the array and break them up
for($x=0;$x<=$#homes;$x++)
# for each entry in the array, do the following, then increment the value and start with the next entry
{
@homes[$x]=$root."/".@homes[$x].$prefs;
# update the list from "username" to "/$root/username/$prefs"
}
foreach $i (@homes)
# for each entry in @homes
{
print("$i\n"); # print out the user directory
`cp @ARGV[0] $i`; # copy the filename passed to all the directories?
}