How to escape the single quote character in an ssh / remote bash command?

前端 未结 5 2148
春和景丽
春和景丽 2020-12-01 07:51

I\'m building a small set of scripts for remotely starting, stopping and checking the status of a process. The stop of these scripts should look for a process a

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 08:42

    Another example is to deal with simple or double quotes because for me for example I needed interpretation and variable replacements. If I want to make a function to display a msg to the macOS of my woman I can do followings:

    ssh womanLptp "osascript -e 'tell app \"System Events\" to display dialog \"${1}\"'"
    

提交回复
热议问题