print double quotes in shell programming

前端 未结 3 1230
春和景丽
春和景丽 2020-12-09 16:36

I want to print double quotes using echo statement in shell programming.

Example:

echo \"$1,$2,$3,$4\";

prints

3条回答
  •  死守一世寂寞
    2020-12-09 17:04

    You should escape the " to make it visible in the output, you can do this :

    echo \""$1"\",\""$2"\",\""$3"\",\""$4"\"
    

提交回复
热议问题