Page 1 of 1
having some troubles with [find...]
Posted: Sat Apr 09, 2011 12:26 am
by 1littlewisp
so I'm trying to use find to change queues. what I'd like to do is change them based on what they're set at now. So I'm using find like this:
/queue simple print from=[find burst-limit=5120k/5120k]
just to try to get the data that I want to change. the command above doesn't work. it does work when I look for other parameters, though. For example:
/queue simple print from=[find interface=all]
My question for the community is: wtf?
thanks.
Re: having some troubles with [find...]
Posted: Sat Apr 09, 2011 12:38 am
by fewi
Some parameters (I wish I could be more accurate than the word 'some', but there you go) require quotation marks.
Try
/queue simple print from=[find burst-limit="5120k/5120k"]
It may also be helpful to always fully specify the paths just in case scope isn't what you expected:
/queue simple print from=[/queue simple find burst-limit="5120k/5120k"]
That said, I don't know how to interpret that use of 'from'. If you only want to print certain elements I am under the impression you should be using 'where':
/queue simple print where burst-limit="5120k/5120k"
Re: having some troubles with [find...]
Posted: Tue Apr 12, 2011 6:59 pm
by 1littlewisp
Oh, I see. I just needed to escape the values of burst-limit because the "/" is a special character. I'll tell you what the ultimate goal is here: to change the bust limits of queues that meet certain conditions. In other words, "if the queue's burst-limit is 5120k/5120k, set it to 10240k/10240k."
How would you do that?
Re: having some troubles with [find...]
Posted: Tue Apr 12, 2011 8:35 pm
by fewi
/queue simple set [/queue simple find burst-limit="5120k/5120k"] burst-limit="10240k/10240k";
Re: having some troubles with [find...]
Posted: Tue Apr 12, 2011 9:41 pm
by 1littlewisp
Thanks, fewi. I'm not well trained in programming logic, so learning the CLI can be especially difficult. I've written a few scripts with conditional statements, but anything C-like really starts to screw with me. I've been trying to figure it out by trial and error, picking up bits of information here or there, but I was limited by a poor foundational understanding.