JUNOScripting
programming languages in which the cycle is done only through the recursion, I had to write (lisp, exim acl).
But the language in which it is impossible to change the values of the variables met the first time. 8-() It is not clear, actually, why they are called "variables". I recall the anecdote "and Dostum did not try?"
Okay I did not understand how it works internally. But in his time a lot of writing on ACME - there are also variables and conditional / unconditional jump, and much more, then suddenly was not in the language "High level". Of course, I know the term "algorithmic" and "functional" language, but still turn out their brains, so that use recursion instead of cycle was natural to me napryazhno. A variable for some reason sometimes you want to change.
But nothing has mastered SLAX (Stylesheet Language Alternative Syntax) and wrote a script that was needed.
unpleasantly surprised by the low efficiency. Somehow, I expect that if the script runs through the junos api, then they speed should be okay, by analogy with embedded perl and other embedded scripting languages. Nifiga - query configuration is about half a minute (as in "show configuration"). Commit even more. Here I do not understand I'm what you need to do to a text file of two megabytes for modern processor to parse a minute? Me and a second on this task is difficult to imagine. And patches with dynamic-db - I would have understood if there was dvuhgigovy file instead dvuhmegovy.
Other hohmochki, of course, also delivered. For example, arithmetic expressions is, and there is no division (or I could not find how). Well, okay then, instead of dividing into two may be multiplied by 0.5. But why is printf ("% d", 6000000000 * 0.5) returns "3e +09", which, of course, the parser config is not perceived?
Of course, the ideology of change / commit in JunOS much easier than in Cisco IOS. But why can not Commit changes only, not the entire config? Or lock the only one level of hierarchy, config, and not all of it? It's not rocket science. And without this script can safely change the configuration (for example, update the prefix-lists or something on the events)? After all, suddenly it's time someone something to configure? And the result is a system, which usually works well, "" buggy infrequently, "etc. :-( Pro" configure private "know - it's a good way to undo somebody else's changes and do not notice it.
The fact that others still worse, comforts, but not much.:)
PS And in general, junoscripts - a powerful thing, I Proper.
0 comments:
Post a Comment