2
Management
26
The
CLI
script
command
is
the
tool
used
for
script
management
and
execution.
The
complete
syntax
of
the
command
is
described
in
the
SEG
‐
100
Command
Line
Interface
Reference
and
specific
examples
of
usage
are
detailed
in
the
following
sections.
See
also
Command
line
interface
on
page
15
.
Note:
Uploaded
CLI
script
files
are
not
held
in
permanent
memory
and
will
disappear
after
system
restarts.
All CLI commands are allowed in scripts
There
are
no
restrictions
on
which
CLI
commands
can
appear
in
an
SEG
script.
Any
valid
command
can
be
used.
Executing scripts
As
mentioned
above,
the
script
‐
run
command
launches
a
named
script
file
that
has
been
previously
uploaded
to
the
SEG.
For
example,
to
execute
the
script
file
my_script.sgs
that
has
already
been
uploaded,
the
CLI
command
would
be:
Device:/>
script
‐
run
‐
name=my_script.sgs
Script variables
A
script
file
can
contain
any
number
of
script
variables
that
are
called:
$1,
$2,
$3,
$4......$n
The
values
substituted
for
these
variable
names
are
specified
as
a
list
at
the
end
of
the
script
‐
run
command
line.
The
number
n
in
the
variable
name
indicates
the
variable
value’s
position
in
this
list.
$1
comes
first,
$2
comes
second,
and
so
on.
Note:
The
name
of
the
first
variable
is
$1
.
The
variable
$0
is
reserved
and
is
always
replaced
before
execution
by
the
name
of
the
script
file
itself.
For
example,
a
script
called
my_script.sgs
is
to
be
executed.
The
IPv4
address
126.12.11.01
is
to
replace
all
occurrences
of
$1
in
the
script
file
and
the
string
sfp1
address
is
to
replace
all
occurrences
of
$2
.
The
file
my_script.sgs
contains
the
single
CLI
command
line:
add
Address
IPAddress
sfp1_ip
Address=$1
Comments=$2
To
run
this
script
file
after
uploading
to
the
SEG
with
the
given
substitutions,
the
CLI
command
would
be:
>
script
‐
run
‐
name=my_script.sgs
126.12.11.01
"sfp1
address"
Notice
how
the
“sfp1
address”
parameter
is
enclosed
in
quotes
so
any
spaces
can
be
included.
When
the
script
file
runs,
the
replacement
of
the
variables
means
that
the
command
becomes:
add
Address
IPAddress
sfp1
Address=126.12.11.01
Comments="sfp1
address"