anchor.diff:  
   %%-define(DEBUG,1).
   -ifdef(DEBUG).
  --define(dbg(Data),erlang:display(Data)).
  +-define(dbg(Data),ct:pal("~p",[Data])).
   -else.
   -define(dbg(Data),noop).
   -endif.
  
positive.code:     {ok, Logs} =
          rtnode([
                  {putline, ""},
                  {putdata, [$\^p]}, {sleep,50}, %% the halt.
                  {putdata, [$\^p]}, {sleep,50}, %% the echo.
                  {putdata, [$\n]},
                  {getline, "echo"}
                 ], [], [], "-kernel shell_history enabled " ++ mk_sh_param(Path)),
  
negative.code: 	    after Timeout1 ->
  		    {error, kill_timeout}
  	    end;
          {timeout,Timer,timeout} ->
              #{ get := #{ tag := Tag, from := Pid, timer := Timer } } = State,
              Pid ! {Tag, timeout},
              toerl_loop(maps:remove(get, State));
  	{Port, eof} ->
  	    {error, unexpected_eof};
  	Other ->
  	    {error, {unexpected, Other}}
      end.
  
  handle_match(#{ acc := Acc, get := #{ tag := Tag,
                                        match := Match,
                                        from := From,
                                        timer := Timer}} = State) ->
      case string:split(Acc, Match) of
          [Pre,Post] ->
              ?dbg({match,Pre}),
              From ! {Tag, Pre},
              erlang:cancel_timer(Timer),
              receive
                  {timeout,Timer,timeout} ->
                      ok
              after 0 ->
                      ok
              end,
              maps:put(acc, Post, maps:remove(get, State));
          [Acc] ->
              State
      end;
  handle_match(State) ->
      State.
  
  rtnode_check_logs(Logname, Pattern, Logs) ->
  rtnode_check_logs(Logname, Pattern, true, Logs).
  