Jump to content
Server Maintenance This Week. ×

System-level scripts & parameters


This topic is 4258 days old. Please don't post here. Open a new topic instead.

Recommended Posts

It's great I can run run system-level scripts through FMS. There is an option to include parameters, but I've never used that. How would a shell script access those parameters?

A quick look at Unix scripting makes me think that if I pass parameters as...

ABC 321 "blue dog"

...then I can reference those parameters as $0 $1 and $2.

so:

echo "i like the $2"

would return

i like the blue dog

Is that the correct method for handling system-level script parameters?

Thanks,

DJ

Link to comment
Share on other sites

That's how it is done. Make sure to use quotes around parameter values that have spaces in them.

On Windows I would use a VBscript rather than a batch file when I need to pass parameters. VBscript allows for more power in the code to work with the parameters (or arguments as they are called) - putting them in a nice array.

Link to comment
Share on other sites

This topic is 4258 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.