I’m attempting to send an email from RouterOS 7.20 containing a list of files. If I hard-code the list of files, it works perfectly:
/tool e-mail send to=”my.email.address@mydomain.mytld” \
subject=”test email” body=”See attached list of files” \
file=myrouter-file1,myrouter-file2,myrouter-file3…
However, I need the list of files to be dynamically generated.
This doesn’t work:
/tool e-mail send to=”my.email.address@mydomain.mytld” \
subject=”test email” body=”See attached list of files” \
file="$[/system identity get name]-file1","$[/system identity get name]-file2","$[/system identity get name]-file3"
input does not match any value of file
I’ve tried passing the list of files via an array, like this:
:global files {"$[/system identity get name]-file1","$[/system identity get name]-file2","$[/system identity get name]-file3"}
/tool e-mail send to=”my.email.address@mydomain.mytld” \
subject=”test email” body=”See attached list of files” file="$files"
I’ve tried without enclosing the array name in quotes, like this:
/tool e-mail send to=”my.email.address@mydomain.mytld” \
subject=”test email” body=”See attached list of files” file=$files
Nothing I try works.
As a programmer I feel I should be able to understand how to do this, but everything I’ve tried simply results in the input does not match any value of file error.
I like how much more elegant the use of variables is for this; thanks for that.
What point are you making in the opening sentence where you say close quotes are not the same as quotes? It seems like you may as well have said apples are not the same as oranges, unless I'm missing something subtle?
That is so curious. I think that must be due to wysiwyg editor here converting the quotes - I definitely don't have them that way in my actual scripts. I started out writing the question using the "rich text editor" option in the toolbar, but then switched it to the standard markdown editor because that mode is much easier to use.
As a test, I wrote the below sentences using the regular "quote" key on my keyboard, just switching between editor modes:
This bit was written using the “rich text editor”.
This bit was written using the "standard markdown editor".
For a technical site it would likely be better if the editor didn't make those assumptions, and just entered the actual letters typed into the editor, regardless of whether it is in "rich text" mode or not.
Old fashioned forum engine (phpBB) is more simple but does not many things behind the scenes.
Current forum engine is newer/popular/nice/modern/convinient/etc. and tries to do a lot things helping out. Sometimes that help goes past golden meana as the engine tries to be "too clever".