Cleaning script code

I need some help with this:

Script do work fine, but the result form X86 may come like this:
KSLqB0/r6cI
The / makes it impossible to use as a file or folder name. I tried to clean it up by remove it, but failed.
Is there any quick fix, or de vi ned to loop trough one bye one character and test it? And test characters like this / I guess needs escaping.

http://forum.mikrotik.com/t/convert-identity-name-to-uppercase/161897/6
Replace with _ any unusable filename characters, this can be applied everywhere before create a filename to be used…


Or simply use original ether1 MAC address, as already suggested:
:global remdots do={
:local string $1
:if (([:typeof $string] != “str”) or ($string = “”)) do={ :return “” }
:local lenstr [:len $string]
:local chr “”
:local constr “”
:for pos from=0 to=($lenstr - 1) do={
:set chr [:pick $string $pos ($pos + 1)]
:if ($chr != “:”) do={:set constr “$constr$chr”} ; # else={:set constr “$constr-”}
}
:return $constr
}

:put [$remdots [/int eth get ([find]->0) orig-mac-address]]
on script remove “; #” for replace “:” with “-”

Thanks :slight_smile: