Specifications
Managing Configuration and Image Files script
2-76 Startup and General Configuration
Thisexampleshowshowtodeletethe“010300”imagefile:
Matrix(rw)->delete images/010300
script
Usethiscommandtoexecuteascriptfile.
Syntax
scriptfilename[arg1][arg2][arg3][arg4][arg5][arg6][arg7]
Parameters
Defaults
None.
Mode
Switch,Read‐Write.
Usage
ThescriptfilemustfirstbecreatedonaPCandcopiedtotheMatrixdeviceusingthecopy
command(“copy”onpage 2‐74)beforethescriptcanbeexecuted.Thefilecancontainany
numberofswitchcommands,uptoamaximumfilesizeof128kilobytes.Routercommands
cannotbeincludedinthefile.Scriptscannotbenestedwithinthefile.Notethatthehistory
commandwillnotreflecttheexecutionofcommandswithinascriptfile.
Example
Thisexampleusesthecopycommandtocopythescriptfilenamed“setport.scr”fromIPaddress
10.1.221.3toslot4.Next,thecontentsofthefileisdisplayedwiththeshowfilecommand.The
scriptfilerequirestwoarguments,aportstring(%1)andaVLANid(%2).F inally,thescript
is
executed,byspecifyingfe.1.1asthefirstargumentand100asthesecondargument.
Matrix(rw)->copy tftp://10.1.221.3/setport.scr slot4/setport.scr
Matrix(rw)->show file slot4/setport.scr
set port alias %1 script_set_port
set port vlan %1 %2 modify-egress
set port jumbo enable %1
set port disable %1
set port lacp port %1 disable
Matrix(rw)->script slot4/setport.scr fe.1.1 100
Whenthescriptcommandparsesthefileandperformsthecommandlineargumentsubstitution,
thecommandsareconvertedtothefollowing:
set port alias fe.1.1 script_set_port
filename Specifiesthelocalpathnametothefile.Validdirectoriesare/images
and/slotN.
arg1througharg7 Specifiesuptosevenargumentstothescript.