Skip to content

str2str : parenthesis error with message interval in -msg option #770

@harlock974

Description

@harlock974

I just wanted to share a solved issue I took some time to understand, in case others meet it.

I am using RTKLIB-b34L and tried to send an RTCM3 stream to a serial port by filtering some message types, with the command :

str2str -in tcpcli://localhost:5016#rtcm3 -out serial://ttyUSB0:38400:8:n:1#rtcm3 -msg 1006(10),1074(2),1094(2),1124(2)

According to the manual, the syntax is correct, but I had this error :

-bash: syntax error near unexpected token '('

To the contrary, the following command, without the parenthesis, works :

str2str -in tcpcli://localhost:5016#rtcm3 -out serial://ttyUSB0:38400:8:n:1#rtcm3 -msg 1006,1074,1094,1124

In fact, it is a bash issue, not str2str. Parenthesis have special meanings in bash, so you need to escape or quote them :

This one works : -msg 1006\(10\),1074\(2\),1094\(2\),1124\(2\) but it is ugly.
Better to use : -msg "1006(10),1074(2),1094(2),1124(2)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions