1、js中的json对象和字符串之间的转化:http://www.oschina.net/code/snippet_175925_6288
代码片段:
var obj = JSON.parse(description[field]); var str = JSON.stringify(obj, null, " "); $("#id_{{item.Field}}").val(str); var obj = JSON.parse($("#id_{{item.Field}}").val()); var str = JSON.stringify(obj); requestParameters["{{item.Field}}"] = str;
2、shell字符串替换实现:http://blog.csdn.net/lepton126/article/details/31375935
http://www.cnblogs.com/chengmo/archive/2010/10/02/1841355.html
%x=abcdabcd %echo ${x/a/b} # 只替换一个 bbcdabcd %echo ${x//a/b} # 替换所有 bbcdbbcd 举例 #test='liu.' #echo ${test//'.'/'.'} liu.
shell中"示例:
#! /bin/bash K8s_Params=$* # echo ${K8s_Params} K8s_Params=${K8s_Params//"/"} # echo ${K8s_Params} cd /root && python test_docker.py ${K8s_Params}