# New script organization

**URL:** <https://community.zeek.org/t/new-script-organization/1967>\
**Category:** Development\
**Tags:** development\
**Created:** [August 7, 2011, 5:07pm UTC](https://community.zeek.org/t/new-script-organization/1967 "2011-08-07T17:07:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregor\_Maier](https://avatars.discourse-cdn.com/v4/letter/g/94ad74/32.png) [@Gregor\_Maier](https://community.zeek.org/u/Gregor_Maier)\
**Post date:** [August 7, 2011, 5:07pm UTC](https://community.zeek.org/t/new-script-organization/1967/1 "2011-08-07T17:07:06Z")

</div>

Hi,

I really like the new script layout. Having just poked at it, it really is a lot easier to find stuff in there 🙂

I do however have some quick comments:

\* I would rename "all.bro" to "default.bro". I think "all" is  
&nbsp;&nbsp;&nbsp;misleading, since it doesn't load everything, it rather loads the  
&nbsp;&nbsp;&nbsp;default config.

\* I would also rename use the extension ".init" for the file, since its  
&nbsp;&nbsp;&nbsp;automatically loaded by the core without script intervention. I.e.,  
&nbsp;&nbsp;&nbsp;call it "default.init".

\* I would move the test check whether "default.init" should be loaded  
&nbsp;&nbsp;&nbsp;into the core and not handle that at the script level.

\* Does it make sense to do some BROPATH magic? For each path in  
&nbsp;&nbsp;&nbsp;BROPATH, we could automatically add "/policy", "/site", "/base"?  
&nbsp;&nbsp;&nbsp;But YMMV.

I'd like to see the first three points. Not so sure about the last one though.

cu  
Gregor

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [August 7, 2011, 6:52pm UTC](https://community.zeek.org/t/new-script-organization/1967/2 "2011-08-07T18:52:37Z")

</div>

> \* I would rename "all.bro" to "default.bro". I think "all" is  
> \* I would also rename use the extension ".init" for the file, since its  
> \* I would move the test check whether "default.init" should be loaded  
> &nbsp;&nbsp;&nbsp;into the core and not handle that at the script level.

I like these (the final one only if we did a command line option  
though).

> \* Does it make sense to do some BROPATH magic? For each path in  
> &nbsp;&nbsp;&nbsp;BROPATH, we could automatically add "/policy", "/site", "/base"?  
> &nbsp;&nbsp;&nbsp;But YMMV.

I don't like this at all. 🙂

Robin

---

<div class="post-metadata">

**Author:** ![Seth\_Hall3](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Seth\_Hall3](https://community.zeek.org/u/Seth_Hall3)\
**Post date:** [August 8, 2011, 2:38pm UTC](https://community.zeek.org/t/new-script-organization/1967/3 "2011-08-08T14:38:08Z")

</div>

> \* I would rename "all.bro" to "default.bro". I think "all" is  
> \* I would also rename use the extension ".init" for the file, since its  
> \* I would move the test check whether "default.init" should be loaded

Agreed on all points. I'll make sure those happen soon.

> \* Does it make sense to do some BROPATH magic? For each path in  
> &nbsp;&nbsp;BROPATH, we could automatically add "/policy", "/site", "/base"?  
> &nbsp;&nbsp;But YMMV.

I agree with Robin here. If we start adding lots of directories to the BROPATH it would get confusing to tell where something is loading from when you see "@load xxx" in a script.

&nbsp;&nbsp;.Seth

---

<div class="post-metadata">

**Author:** ![Jonathan\_Siwek](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@Jonathan\_Siwek](https://community.zeek.org/u/Jonathan_Siwek)\
**Post date:** [August 8, 2011, 2:46pm UTC](https://community.zeek.org/t/new-script-organization/1967/4 "2011-08-08T14:46:09Z")

</div>

> \* I would also rename use the extension ".init" for the file, since its  
> &nbsp;&nbsp;automatically loaded by the core without script intervention. I.e.,  
> &nbsp;&nbsp;call it "default.init".

I don't like the use of ".init" for anything. To me, that's implying it might not be the same language as the other scripts. Is there an advantage of using the exceptional extension? Maybe it was originally meant to imply it's an internal script, but now anything in "base/" could almost be considered "internal".

Just throwing out an idea: use a "default.bro" and then change "bro.init" =\> "core.bro".

- Jon

---

<div class="post-metadata">

**Author:** ![Seth\_Hall3](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Seth\_Hall3](https://community.zeek.org/u/Seth_Hall3)\
**Post date:** [August 8, 2011, 2:52pm UTC](https://community.zeek.org/t/new-script-organization/1967/5 "2011-08-08T14:52:12Z")

</div>

That's actually a really good point. I think I could go for that. The first time I saw the bro.init script I was pretty confused since it's just a plain Bro script.

&nbsp;&nbsp;.Seth

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [August 8, 2011, 3:25pm UTC](https://community.zeek.org/t/new-script-organization/1967/6 "2011-08-08T15:25:12Z")

</div>

> it might not be the same language as the other scripts. Is there an  
> advantage of using the exceptional extension?

It indicates that loading them is hard-coded into the core, there's  
nothign the script-level can do about that. But you're right in that  
the .init extension can be misleading.

> Maybe it was originally meant to imply it's an internal script, but  
> now anything in "base/" could almost be considered "internal".

These scripts are still different than the other base/\* stuff, which  
is loaded from other scripts. I'd like to keep that distinction  
somewhow. How about using a prefix, like "init-bare.bro" and  
"init-default.bro" instead?

> "bro.init" =\> "core.bro".

(Let's avoid the term "core", that's already overloaded.)

Robin

---

<div class="post-metadata">

**Author:** ![Jonathan\_Siwek](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@Jonathan\_Siwek](https://community.zeek.org/u/Jonathan_Siwek)\
**Post date:** [August 8, 2011, 3:33pm UTC](https://community.zeek.org/t/new-script-organization/1967/7 "2011-08-08T15:33:45Z")

</div>

> These scripts are still different than the other base/\* stuff, which  
> is loaded from other scripts. I'd like to keep that distinction  
> somewhow. How about using a prefix, like "init-bare.bro" and  
> "init-default.bro" instead?

I like it.

- Jon

---

<div class="post-metadata">

**Author:** ![Seth\_Hall3](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Seth\_Hall3](https://community.zeek.org/u/Seth_Hall3)\
**Post date:** [August 8, 2011, 4:12pm UTC](https://community.zeek.org/t/new-script-organization/1967/8 "2011-08-08T16:12:38Z")

</div>

So do I. I'll go that route.

.Seth

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:39pm UTC](https://community.zeek.org/t/new-script-organization/1967/9 "2022-05-06T15:39:44Z")

</div>


