LOCal
Create/Delete a variable in the local scope
- LOCal
Shortest form:
loc.Create, change or delete a variable in the current scope. Each
rcloadscript runs in a scope of its own, so a variable set withlocalinside a script is gone when the script ends. At thedrivshell>prompt there is no local scope:localthere sets a global variable, whichprintenvlists underGlobal Variablesand which stays set, acrossbcmcmdcalls andbcmshsessions, until you delete it orsyncdrestarts.local: list the variables of the current scope.local <name>: delete the variable.local <name> <value>: set it.
More than two arguments is an error. Names starting with
_cannot be set. Affects only the shell. See Scripting.Hardware-validated
drivshell> local port ce0 drivshell> echo $port ce0
Built-in help
Parameters: <variable> [<value>] Set variable <variable> to a specific value <value>, in the local scope only. Variable in the local scope are not visible in recursive diag shells or in rc load files. System variables are those that begin with an "_". They may be referenced but not set. Use printenv to show the system variables.Further reading
SDK-6.5.20 HSDK Getting Started Guide (GS-SDK6520-R), plus SDK-6.5.20/21/22 Release Notes (RN-SDK65xx-R), OpenBCM sdk-6.5.27/rc: rc.soc, config.bcm, td3_sanity.soc, cmd_td3_tr514_lr.soc, tr51/tr517_bcm56870_a0.soc, bcm_diag_info.soc …, BCM_SDK命令.