请团队帮助解决错误警报!:不支持的 URL 方案!在 Linux bash 脚本中发送批量短信时。 lynx 命令适用于静态 URL。这就是我在下面得到的
#!/bin/bash
a="lynx -dump 'http://localhost:13013/cgi-bin/sendsms?from=8005&to="
b="&username=tester&password=foobar&smsc=smsc1&text=Test+mt+update'"
for i in cat numbers.txt;do $a$i$b;echo sent $i; done;
数字
258909908780
256789123456
676675234789
最佳答案
问题出在http:
之前的单引号。扩展变量后不会处理引号,因此它会按字面意思发送到 lynx。没有 'http
URL 方案,因此出现错误消息。
删除http:
之前和+update
之后的引号。
#!/bin/bash
a="lynx -dump http://localhost:13013/cgi-bin/sendsms?from=8005&to="
b="&username=tester&password=foobar&smsc=smsc1&text=Test+mt+update"
for i in $(cat numbers.txt);do $a$i$b;echo sent $i; done;
有关此内容的更多信息,请参阅
关于linux - 警报!使用 lynx 发送批量短信时出现 : Unsupported URL scheme! 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27223806/