Edit script from terminal

What’s the syntax to update a script source from the terminal? Edit: Version is ROS 5.15. Slightly behind, but I doubt it’ll make a difference.

Say I have the export:

/system script
add name=awesome_script policy=\
    ftp,reboot,read,write,policy,test,winbox,sniff,sensitive source="#### Blah\
    blah blah\r\
    \n###########################################\r\
    \n#\r\
    \n# This script is awesome\r\
    \n#\r\
    \n###########################################\r\
    \n:log info \"Awesome script run!\""

And I want to update the script to be:

/system script
add name=awesome_script policy=\
    ftp,reboot,read,write,policy,test,winbox,sniff,sensitive source="#### Blah\
    blah blah\r\
    \n###########################################\r\
    \n#\r\
    \n# This script is even more awesome\r\
    \n#\r\
    \n###########################################\r\
    \n:log info \"Awesome script run! Now even more awesome\""

I could cut and paste the script into a winbox window. However, I want to do it from the CLI. The expected command, /system script edit awesome_script source=“blah blah blah” is dying as it doesn’t appear to take multiline input:

[root@router] /system script> /system script
[root@router] /system script> edit awesome_script source="#### Blah\
expected end of command (line 1 column 25)
[root@router] /system script>    blah blah\r\
syntax error (line 1 column 14)

How should I be doing this instead?

Using “edit”, you edit “manually” the source in a (terminal) editor. If you want to use a command to automate such editions, you’d need to use “set” instead. So…

To edit “manually”:

/system script edit awesome_script source

To edit “automatically”:

/system script set awesome_script source="#### Blah\rblah blah"

Derp. Don’t know why I didn’t think to use set – thanks.