#!/bin/bash
# Connection to CR
read -p "CRIP: " varCRIP
read -p "CRUSER: " varCRUSER
read -p "CRPASS: " varCRPASS
echo curl -k -X GET “http\://$varCRIP/cgi-bin/CGILink\?cmd=validate\&user=$varCRUSER\&passwd=$varCRPASS”
#curl -k -X GET “http\://$varCRIP/cgi-bin/CGILink\?cmd=validate\&user=$varCRUSER\&passwd=$varCRPASS"
btude@DESKTOP-SQI0GTI:~$ ./ccr.sh ': not a valid identifiervarCRIP ': not a valid identifiervarCRUSER ': not a valid identifiervarCRPASS curl -k -X GET “http:///cgi-bin/CGILink?cmd=validate&user=&passwd=”
HELP!
我正在尝试在var中输入数据,然后将其插入curl命令中以运行
答案 0 :(得分:1)
您的报价”
看起来很奇怪。这可能意味着你的东西中有一个不易破碎的空间,因为你从MS-Word或其他东西复制/粘贴。
尝试此操作(手动重新输入空格):
read -p "CRIP:" varCRIP
read -p "CRUSER:" varCRUSER
read -p "CRPASS:" varCRPASS
然后更改你的报价:
curl -k -X GET 'http\://$varCRIP/cgi-bin/CGILink\?cmd=validate\&user=$varCRUSER\&passwd=$varCRPASS'