bash

作者: 小小爱笑 | 来源:发表于2018-11-28 16:46 被阅读0次

    函数参数

    sql="Insert into table1 ..."

    exec_acsql_mysql $@ ${sql}
    

    函数exec_acsql_mysql 接收到的最后一个参数是insert 而不是 "Insert into table ..."

    需要对带空格的字符串加引号

    exec_acsql_mysql $@ "${sql}"
    

    函数 可通过echo 传递返回值

    exec_acsql_mysql() {
     echo "result is ..."
    }
    
    result=`exec_acsql_mysql $@ ${sql}`
    

    函数exec_acsql_mysql 接收到的最后一个参数是insert 而不是 "Insert into table ..."

    需要对带空格的字符串加引号

    exec_acsql_mysql $@ "${sql}"
    

    数组

    params=()
    #
    ${params[0]}
    ${params[1]}
    
    ${params[@]}
    

    添加条目

    params=(${params[@]}  item1)
    

    提取数组的值 使用{params[@]} 。 与普通变量params不同


    window 定时任务 taskschd.msc


    curl

    curl -v -X POST
    http://localhost:8080/loginJSON
    -H 'content-type: application/json'
    -d '{ "user": "manu" }'

    -v 详细输出

    -x, --proxy <[protocol://][user:password@]proxyhost[:port]>
    Use the specified proxy.
    设置代理

    curl -v --insecure -x https://user:pass@proxy.com:8080 http://pic.58pic.com/58pic/15/14/29/47e58PICQUR_1024.jpg -o test.jpg
    设置代理, 忽略tls证书验证

    相关文章

      网友评论

          本文标题:bash

          本文链接:https://www.haomeiwen.com/subject/vflzqqtx.html