SAVE

Write data to a file

SAVE

Write text to a file, replacing its contents.

  • save <file> <word> …: write the words, separated by spaces, as one line.

  • save <file>: read lines typed at the < `` prompt until end of input (:kbd:`Ctrl-D`). This does not work through ``bcmcmd; use the one-line form.

Paths are inside the syncd container, and the command runs there as root. Together with rcload it is a quick way to make a small script without leaving the shell. Single quotes keep $1 from being expanded while saving.

Hardware-validated

drivshell> save /tmp/show-ports.soc ps '$1'
drivshell> rcload /tmp/show-ports.soc ce0
                 ena/        speed/ link auto    STP                  lrn  inter   max   cut   loop
           port  link  Lns   duplex scan neg?   state   pause  discrd ops   face frame  thru?  back   encap
       ce0(  1)  !ena   4  100G  FD   SW  No   Forward         Untag    F    CR4  9122    No          IEEE

Built-in help

Parameters: <file> [<word> ...]
    Write data to a file. If only file is given, the console is read
    until EOF (CTRL-D) is seen. Otherwise, all the words on the
    command line are written with a single "Space" between them

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).