scripts and $ parameters

Bukira
Contributor

Hi Guys

Im trying to create a script where I can use the Casper $4 - $11 parameters.

Ive created a script that works locally and i want to substitute one of the parameters with $4 so that i can then add that parameter in Casper Remote when i use the script.

Ive add the script to Casper Admin and then in Casper Admin given $4 parameter a name.

I then go into Casper Remote, select the script and put my value in the named parameter, what else do i need to do to get the script to work? In the script do i just substitute my value for $4, or do i need to add some other code to take that value from Casper?

Criss Criss Myers
Senior Customer Support Analyst (Mac Services)
Apple Certified Technical Coordinator v10.5
LIS Business Support Team
Library 301
University of Central Lancashire
Preston PR1 2HE
Ex 5054
01772 895054

1 REPLY 1

Not applicable

When Casper executes your script, it will call it like this:

./yourscript [param1] [param2] [param3] [your-param4] [your- param5] ... [your-param11]

You can just use $4 in your script to access the value you placed there in the policy. You may need to put the value in the policy in quotes -- try it both ways. Also, a good script should make sure it has a value if it needs one, just in case the person who set up the policy forgot to provide it.

A great script for seeing what happens when you populate parameters is the BashExample.sh test script that you may've installed with Casper. I have attached the file for you.

Cheers,
Clinton