Closed vird closed 2 years ago
You can accept the parameter with dots and then replace dots by null bytes. "A.B.C" -> "A\0B\0C\0".
Yes, if the problem is only in parsing the command line argument of a Fift script, you can use the suggestion above:
// ( S -- S' ) Replaces all dots in S with null characters
recursive dots-to-nulls {
dup $len { 1 $| dots-to-nulls swap dup "." $= { drop B{00} B>$ } if swap $+ } if
} swap !
"test.google.com" dots-to-nulls $>B Bx.
7465737400676F6F676C6500636F6D ok
Seems there is no easy way to call command line tools with argv with zero bytes. related stuff: https://unix.stackexchange.com/questions/344829/using-binary-data-as-a-parameter-in-bash-any-way-to-allow-nuls
Can we use dots in DNS challenge insted of \0?