我可以将注释(注释掉的代码或不影响脚本的注释)放在 shell 脚本的单引号内吗?
我尝试了以下方法来使这些工作:
# comment
\# comment
\/\* comment \*\/
下面是我正在尝试做的一个例子。你会看到我的评论以散列开头,并且在 curl 请求的数据包内的单引号内。
curl -XPOST 'http://ec2-54-234-64-66.compute-1.amazonaws.com:9200/nsns/nsn/_mapping?pretty=true' -d '{
"nsn" : {
"type" : "object",
"include_in_all" : "false",
"index" : "no",
"properties" : {
# this data is used for facetting END
"id" : { "type" : "long", "include_in_all" : "true" },
"BDC_CODE" : { "type" : "byte" },
"KID" : { "type" : "byte" },
"ITEM_STANDARDIZATION_CODE" : { "type" : "string" },
# we don't know what these field's data look like yet
"stock_on_hand" : { "type" : "integer" },
"non_stocked_items" : { "type" : "integer" },
"stocked_restrictions" : { "type" : "string" },
"consistency_of_spend" : { "type" : "string" },
"WSDC" : { "type" : "string" }
}
}
}'