cancel
Showing results for 
Search instead for 
Did you mean: 

EXOS 'cat' utility

EXOS 'cat' utility

Dave_Hammers
Extreme Employee
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"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"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;
}}
5 REPLIES 5

Ludovico_Steven
Extreme Employee
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'

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

EXOS-VM.37 #% cat test.cfgthis is my test
EXOS-VM.38 #% edit test.cfgthis is my test
~
...whereas vi directly does not:

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

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.

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.vs.
edit abc.xwith Ludovico's alias
GTM-P2G8KFN