Read architecture and read file?

Hi,

  1. How can I display the contents of a file like in Linux with "cat"?
    This was my approach so far:
    [admin@TESTROUTER] > /log print file=/download/download/LATEST.7
    invalid file name

  2. How can I read my architecture under Mikrotik?
    I've tried this so far:

[admin@TESTROUTER] > /system resource cpu print
Columns: CPU, LOAD, IRQ, DISK

CPU LOAD IRQ DISK

0 cpu0 0% 0% 0%
1 cpu1 2% 0% 0%
2 cpu2 0% 0% 0%
3 cpu3 0% 0% 0%
[admin@TESTROUTER] > /system resource architecture-name print
bad command name architecture-name (line 1 column 18)
[admin@TESTROUTER] >

:put [/file get "download/download/LATEST.7" contents]
:put [/system/resource get cpu]
  1. Thanks, works perfectly

  2. Unfortunately the result looks like this:
    [admin@Switch] > :put [/system/resource get cpu]
    MIPS 24Kc V8.5
    [admin@TESTROUTER] /system> :put [/system/resource get cpu]
    ARM64

But I would like to have arm, arm64 or mipbse only there.

You can pick only 1st part before space or whole value if there is no other parts from cpu value:

:local cpu [/system/resource get cpu]
:local spIdx [:find $cpu " "]
:if ($spIdx > 0) do={
  :put [:pick $cpu 0 $spIdx]
} else={
  :put $cpu
}

I have installed 7.11.2.
When I do that everything stays blank

[admin@Test] > :local cpu [/system/resource get cpu]
[admin@Test] > :local spIdx [:find $cpu " "]
[admin@Test] > :if ($spIdx > 0) do={
{… :put [:pick $cpu 0 $spIdx]
{… } else={
{… :put $cpu
{… }

[admin@Test] >

It must be executed as script, here is single line for CLI if you want like that

:local cpu [/system/resource get cpu]; :local spIdx [:find $cpu " "]; :if ($spIdx > 0) do={ :put [:pick $cpu 0 $spIdx] } else={ :put $cpu }

I would like to download npk files and would need the exact name for a script: routerros-7.11.2-mipsbe.npk

Unfortunately this is what comes out of the script:
[admin@switch] > :local cpu [/system/resource get cpu]; :local spIdx [:find $cpu " "]; :if ($spIdx > 0) do={ :put [:pick $cpu 0 $spIdx] } else={ :put $cpu }
MIPS

Ah, forget above with cpu parsing, now I see, It’s just

:put [/system/resource get architecture-name]

Thank you very much, that was the solution.