How can I escape an arbitrary string for use as a command line argument in Bash?

后端 未结 8 1775
时光说笑
时光说笑 2020-12-08 13:44

I have a list of strings and I want to pass those strings as arguments in a single Bash command line call. For simple alphanumeric strings it suffices to just pass them verb

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 14:13

    This is not a complete answer, but I find it useful sometimes to combine two types of quote for a single string by concatenating them, for example echo "$HOME"'/foo!?.*' .

提交回复
热议问题