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


Click here to return to the 'A bash script to copy one file to multiple users' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A bash script to copy one file to multiple users
Authored by: kerbaugh on Dec 26, '03 02:05:03AM
   This is just a thought but you wouldn't have to worry about empty user input if you used a file input dialog, which is possible by adding a little AppleScript, like so:

thePath="$( osascript<<END
tell application "Finder"
	activate
	choose file with prompt "Choose a file to copy"
end tell

set result to (POSIX path of result as string)
END
 )"
Also, you are only getting the home directories in the /Users directory. You could query NetInfo and get home directories of all users with something like:

nireport . /users home passwd | awk '$2 ~ /../{ print $1 }'
I thought that since you were learning that you might appreciate a couple interesting variations.

[ Reply to This | # ]