[Casper] Using $1, $2, $3 etc...
Clinton Blackmore
clinton.blackmore at westwind.ab.ca
Tue Mar 10 07:29:44 PDT 2009
Page 170 of the Casper Suite 6.0 Documentation.pdf talks about scripts
briefly, and refers you to the example scripts. The example scripts
that come with Casper (they would've been in the original installation
DMG) show that $3 is the current user (although it is only populated
if the script is called at login or logoff.)
The 'w' and 'who' commands will give the users who are currently
logged in. I think
who | grep console | cut -d " " -f 1
will probably be the best way to get a list of all users logged in
graphically.
As for getting a list of all users who have accounts on the machine,
if they are all in the Users folder, you could do something like this:
for USER in `ls /Users` ; do echo $USER ; done
If your users aren't all in the Users folder, you probably have to
move on to using dscl, and it'll take a bit more effort.
Lastly, Casper has facilities to "Fill User Templates" (FUT) and "Fill
Existing Users" (FEU), which helps if you need to create or modify a
file for all users. Or, to really make use of the $3 parameter, you
should create a script that runs at login, scheduled to run once for
each user.
I hope this answers your question.
Cheers,
Clinton
On 10-Mar-09, at 8:07 AM, Dorey, Dustin wrote:
> Does anyone know if there is documentation anywhere on Using $1, $2,
> $3 in scripts to cycle through the users etc…. I know this has
> been discussed a bit before but in digging around the KB and the
> resource kit I can find it in use but would like to review an
> documentation available. I’ve got to make some scripts to deal with
> some imaging issues we had previously and being able to cycle
> through all the existing users would be of great help.
> Thanks folks, I’m sure I’m missing something easy. Still
> adjusting to this daylight savings time thing can’t get the brain
> working right this week.
> -Dusty-
>
> Dustin Dorey
> Technology Support Cluster Specialist
> ISD 196 Apple Valley, Eagan, Rosemount
> dustin.dorey at district196.org
> 952|423|7971
>
> _______________________________________________
> Casper mailing list
> Casper at list.jamfsoftware.com
> http://list.jamfsoftware.com/mailman/listinfo/casper
This email has been scanned by Barracuda Network's Anti-Virus and Spam Firewall.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.jamfsoftware.com/pipermail/casper/attachments/20090310/d597dd79/attachment.html
More information about the Casper
mailing list