vim **.sh文件
开头:#!/bin/bash
//////////
copy cURL //因为这样copy的url就是一个命令(进入chrome的开发者工具里面,点network,找到刚刚访问的页面,右建copy cURL)
///////////
打印输出到log文件:>log 2>errorLog
输出一个字符串:echo "XXXXX" >> log带有换行,不带换行可以使用point
shell测试cURL完整的例子
#!/bin/bash
curl 'http://127.0.0.1:8082/em/pointList' -H 'Cookie: ace_settings=%7B%22sidebar-collapsed%22%3A1%2C%22navbar-fixed%22%3A-1%2C%22sidebar-fixed%22%3A-1%2C%22breadcrumbs-fixed%22%3A-1%7D; JSESSIONID=ylmlgb6eiw6vphsyz2ip2vng' -H 'Origin: http://127.0.0.1:8082' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: http://127.0.0.1:8082/em/main' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'draw=3&columns%5B0%5D%5Bdata%5D=&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=false&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=function&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=false&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=name&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=descr&columns%5B3%5D%5Bname%5D=&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=false&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=&columns%5B4%5D%5Bname%5D=&columns%5B4%5D%5Bsearchable%5D=false&columns%5B4%5D%5Borderable%5D=false&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=&columns%5B5%5D%5Bname%5D=&columns%5B5%5D%5Bsearchable%5D=false&columns%5B5%5D%5Borderable%5D=false&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=&columns%5B6%5D%5Bname%5D=&columns%5B6%5D%5Bsearchable%5D=false&columns%5B6%5D%5Borderable%5D=false&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&start=0&length=5&search%5Bvalue%5D=&search%5Bregex%5D=false&filters=%5B%7B%22field%22%3A%22cond%22%2C%22data%22%3A%22pointName%22%7D%2C%7B%22field%22%3A%22cond%22%2C%22data%22%3A%22all%22%7D%5D&page=point' --compressed >>logPointLineSurfaceManageController 2>>errorLogPointLineSurfaceManageController
echo "-------------pointList--------------">>logPointLineSurfaceManageController
echo "-------------pointList--------------">>errorLogPointLineSurfaceManageController