Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

a mount of feeded parameters

SOLVED
Go to Solution
Trusted Contributor [Founder]

a mount of feeded parameters

Hi everyone

Why this is not working? Script confuse 1 and 10 parameters. What to do?

Script parameters:
IP=$1
comm=$2
message=$3
severity=$4
category=$5
origEvent=$6
target=$7
subject=$8
cardNumber=$9
Instance=$10


Output looks like this:
CardNumber is 1
IPaddress is test.net
Instance is test.net0


Many thanks,
Marko
Marko
3 REPLIES
Highlighted
Honored Contributor [Founder]

Re: a mount of feeded parameters

There are only nine positional parameters available to a script. you'll have to "shift" to get the last one so replace your "Instance=$10" with "shift;Instance=$9"
Never preceed any demonstration with anything more predictive than "watch this"
Trusted Contributor [Founder]

Re: a mount of feeded parameters

Hi

I was thinking that, but I could not believe it!

Marko

Ps. I would test it now.
Marko
Acclaimed Contributor [Founder]

Re: amount of positional parameters

>There are only nine positional parameters available to a script.

 

If more than one digit, you can use ${10}.