RCCache

Save contents of an rc file in memory

RCCache

Shortest form: rcc.

Keep rc scripts in memory. Later rcload calls, and the automatic <word>.soc lookup, then use the cached copy instead of reading the file. With no argument it runs show.

The sub-command words must be spelt out in full (any case). The only short forms are upd for update and del for delete. A name without a leading / is searched in the directories listed in the shell variable path (separated by spaces; default: the working directory). The cache is shell memory only and does not affect the switch.

Hardware-validated

drivshell> rccache
cached /tmp/show-ports.soc (6 bytes)
rccache show [<name>]

Without a name, one cached <name> (<n> bytes) line per cached file. With a name, the same header followed by the cached text, or ERROR: <name> is not cached. Read-only.

Hardware-validated

drivshell> rccache show /tmp/show-ports.soc
RCCache: cached /tmp/show-ports.soc (6 bytes)
ps $1
rccache add <name>

Read the file and cache it. Fails with already cached, file not found or file is empty.

Hardware-validated

drivshell> rccache add /tmp/show-ports.soc
rccache addq <name>

Like add, but succeed quietly if the file is already cached.

Hardware-validated

drivshell> rccache addq /tmp/show-ports.soc
rccache update <name>

Read the file again into the cache, adding it if needed. upd also works.

Hardware-validated

drivshell> rccache update /tmp/show-ports.soc
rccache delete <name>

Remove one file from the cache. del also works.

Hardware-validated

drivshell> rccache delete /tmp/show-ports.soc
rccache clear

Remove all files from the cache.

Hardware-validated

drivshell> rccache clear

Built-in help

Usage:
    rccache show [name]   - show cached rc files or contents of name
    rccache add name      - add rc file 'name' to cached files
    rccache addq name     - like add but only if not already cached
    rccache update name   - reload rc file 'name' into the cache
    rccache delete name   - delete cached rc file 'name'
    rccache clear         - delete all cached rc files

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 …, cPCI-6S10 Series 6U CompactPCI Switch Blade User’s Manual (50-15099-1000, Rev 1.0), BCM_SDK命令.