How do i pass an argument or multiple arguments into a NAS script so i dont have to create the same script multiple times but with a different host name in each one?
HI can you provide mode details?
Usually when using a nas script you read in the information from the alarm
so the host, or IP or robot name is in the incoming alarm and you can use that as needed in the script.
If you can provide an example of what you are trying to accomplish we might be better able to help you.
You don't indicate how you are running the nas script so the answer here will vary.
If this is an AO profile that's running a script, on the profile definition there's a place to put arguments. In your LUA code you'd access that argument value with something like:
local recipient = SCRIPT_ARGUMENT
If you are running the script from the command line, it puts the parameters into a table called arg. At least that's my recollection.
the plan is to use a profile to call the script and to pass in a host name as an argument. ive seen the arguments in the profile definition but it doesnt seem to be working when im testing the scripts.
NAS Scripts dont take start arguments. A Bash/Perl/Java script should match your need no ?
Thomas is actually incorrect, you can pass arguments to an AO profile.
Retrieving data ...