SysTutorials Forums QA How to escape special characters in a Bash string in Linux?

Viewing 0 reply threads

    The problem is with ssh that makes a quoted string to more than one if there are spaces. For example,

    ssh user@host cmd "my string"
    

    The cmd on host will be executed like

    cmd my string
    

    rather than

    cmd "my string"
    

    It will only work if the string is escaped like

    ssh user@host cmd my string
    

    Space is one example, there are many more other special characters in Bash.

    The question is how to escape special characters in a Bash string in Linux nicely and easily?

Viewing 0 reply threads

The forum ‘QA’ is closed to new topics and replies.

Please share if you like this post: