On LOAD » History » Version 2
Per Amundsen, 11/14/2015 02:41 AM
1 | 1 | Per Amundsen | _Added in 1.8.10_ |
---|---|---|---|
2 | |||
3 | *on <level>:LOAD:<commands>* |
||
4 | |||
5 | Triggers the first time a script file is loaded. |
||
6 | |||
7 | *Parameters* |
||
8 | |||
9 | <level> - The level for the event to trigger. |
||
10 | <commands> - The commands to be performed when the event listener's criteria is met. |
||
11 | |||
12 | *Example* |
||
13 | |||
14 | <pre> |
||
15 | ; Create a init alias. |
||
16 | alias -l initscript { |
||
17 | 2 | Per Amundsen | ; Set the %loaded variable to 'on' |
18 | 1 | Per Amundsen | set %loaded on |
19 | } |
||
20 | |||
21 | ; Listen for the LOAD event, and when matched, run this initscript alias. |
||
22 | 2 | Per Amundsen | on *:LOAD:initscript | echo -ag Script is $iif(%loaded,loaded,not loaded) |
23 | 1 | Per Amundsen | </pre> |