You can use INT interrupt(CTRL-C) to stop your LDAS.
To execute some command at staring, modify /usr/bin/alicia written
in perl.
The following is an example:
$alicia = new Alicia('crash'); $alicia->init(); print $alicia->pass_through('sys'); $alicia->run();
If you installed Alicia under default configuration, alicia is at /usr/bin/alicia on your system.
If you don't like the prompt name 'alicia', modify the program name /usr/bin/alicia to /usr/bin/your favorite name
For example, using the external program..
alicia> ps | sort +7n;
Using LDAS..
sub psmem { my ($text, @pss, $header, @mps); $text = pass_through('ps'); $text =~ s/>/ /g; @pss = split(/\n/, $text); $header = shift @pss; @mps = sort { (split(/\s+/,$a))[8]<=>(split(/\s+/,$b))[8]; } @pss; unshift (@mps, $header); return join("\n", @mps); } 1;
Modify the ShellStyle tag in your config file from perl to bash
First of all, please refer to CRASH.pm in the directory where Alicia was installed. For example, to wrap 'lcrash', some functions CRASH.pm has must be implemented.
These functions are:
Alicia allows you to use your favorite editor (e.g. vi or emacs) as follows:
alicia> !vi xxxx.ldas
To load a LDAS on Alicia, I recommend to use 'load' or 'reload' command if you want to use the LDAS on Alicia command line. Because 'load' command will make LDAS name completion available at next version.(2005-02-21)
If you make use of the LDAS on LDAS, you can use 'do' or 'require' function in Perl CORE module because LDAS is just perl subroutine.
Handling STDIN..
while(1) { print STDOUT "YourPrompt> \n"; $input = <STDIN>; chomp($input); 'do something'; if ($input eq 'something'); }
Please refer 'ts.ldas' in /usr/share/ldas (or ldasDir="xxxxx" in alicia.conf).
I don't have a guideline yet. It will be provided by me before long. However if only your LDAS follows the perl fashion and personal use only, you can create LDAS without the guideline.
I recommend to use 'package' function for namespace overlap.
All Rights Reserved, Copyright © 2005, UNIADEX, Ltd.