Header Only - DO NOT REMOVE - Extreme Networks

EXOS 'cat' utility


Userlevel 5
To create a linux like 'cat' utility in EXOS 22.4 and later:

in the exshrc.xsf file add the following line (or create the exshrc.xsf file)

alias cat "run script shell.py cd /usr/local/cfg;cat"[/code]Then the next time you login, the 'cat' alias will be available.

E.g.
# cat exshrc.xsf
alias cat "run script shell.py cd /usr/local/cfg;cat"[/code]E.g.
Suppose there is a file my.pol.
# cat my.pol
entry one {
if {
source-address 1.1.1.1/32;
} then {
meter joe1;
}}
entry two {
if {
source-address 1.1.1.2/32;
} then {
meter joe1;
}}[/code]

5 replies

Userlevel 2
Nice!
Now we need an text edit (vi) command...
...and this seems to do it:
alias edit='run script shell.py cd /usr/local/cfg;vi'[/code]
Userlevel 7
Ludovico Stevens wrote:

Nice!
Now we need an text edit (vi) command...
...and this seems to do it:
alias edit='run script shell.py cd /usr/local/cfg;vi'[/code]

Since
code:
vi
is already available, a simpler line is:
code:
alias edit "vi"
Userlevel 5
Ludovico Stevens wrote:

Nice!
Now we need an text edit (vi) command...
...and this seems to do it:
alias edit='run script shell.py cd /usr/local/cfg;vi'[/code]

running vi in this mode restricts the filenames to specific suffix types
E.g.
vi abc.x
Error: Invalid XOS Cli file extension with vi.
Extension .pkt, .pol, .py, .xml, or .xsf is required.[/code]vs.
edit abc.x[/code]with Ludovico's alias
Userlevel 7
Ludovico Stevens wrote:

Nice!
Now we need an text edit (vi) command...
...and this seems to do it:
alias edit='run script shell.py cd /usr/local/cfg;vi'[/code]

Either of these aliases might cause some weirdness with the 'edit policy ' command. That said, you can just do 'vi ' or (with the alias) 'edit ' instead.
Userlevel 2
Ludovico Stevens wrote:

Nice!
Now we need an text edit (vi) command...
...and this seems to do it:
alias edit='run script shell.py cd /usr/local/cfg;vi'[/code]

Did not realize that vi was already there...
But yes, my alias works:

EXOS-VM.37 #% cat test.cfg[/code]this is my test[/code]
EXOS-VM.38 #% edit test.cfg[/code]this is my test[/code]
~[/code]
...whereas vi directly does not:

EXOS-VM.38 #% vi test.cfg[/code]Error: Invalid XOS Cli file extension with vi.[/code] Extension .pkt, .pol, .py, .xml, or .xsf is required.[/code]
Ciao
Ludovico

Reply