[Casper] Bash Scripts using ~

Ryan Harter rharter at uwsp.edu
Tue Apr 21 08:53:09 PDT 2009


The ~ expands as the current user's home directory.  Login hooks, and  
scripts in general in Casper, are run as root.  That means that ~  
would expand to root's home.

AFAIK it's general practice not to use the ~ in scripts because it's  
not really interpreted the same everywhere.  This probably isn't an  
issue if you're only using them on Mac.

The way you would do this is to use the $3 variable, which Casper sets  
to the username.  Use something like /Users/$3/ to get the user's home  
directory.

Ryan Harter
UW - Stevens Point
Workstation Developer
715.346.2716
Ryan.Harter at uwsp.edu

On Apr 21, 2009, at 10:46 AM, dhowell at austinisd.org wrote:

>
> I can't get any of my login hooks to work in Casper self service. I  
> do have other scripts that work
>
> It seems anytime I use the ~ for logged in user it doesn't work.
>
>
> Is this treated differently in Casper. I run it in terminal it works  
> fine. I am sure It is me doing something wrong
>
>
> D. Trey Howell
> trey.howell at austinisd.org
> Desktop Engineering
>
> Secret Windows code: while (1) { if (num_process > 1)  
> { bluescreen(rand()); } }
>
> This email message, including all attachments, is for the sole use  
> of the intended recipient(s) and may contain confidential student  
> and/or employee information.  Unauthorized use of disclosure is  
> prohibited under the federal Family Education Rights & Privacy Act  
> (20 U.S.C. §1232g, 34 CFR Part 99, 19 TAC 247.2, Gov&#8217, t Code  
> 552.023, Educ. Code 21.355, 29 CFR 1630.14(b)(c)).  If you are not  
> the intended recipient, you may not use, disclose, copy or  
> disseminate this information.  Please call the sender immediately or  
> reply by email and destroy all copies of the original message,  
> including attachments.
> <ATT00001.txt>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.jamfsoftware.com/pipermail/casper/attachments/20090421/a25965e6/attachment.html 


More information about the Casper mailing list