Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

a mount of feeded parameters

SOLVED
Go to solution
Marko Virtanen
Trusted Contributor

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
Mark Grant
Honored Contributor
Solution

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"
Marko Virtanen
Trusted Contributor

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
Highlighted
Dennis Handly
Acclaimed Contributor

Re: amount of positional parameters

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

 

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