我正在开发一个小型项目,它将扫描大约6,000个网址并告诉我哪些链接到我的网站,如果它们被标记为rel=no-follow
我正在进行反向链接清理。我需要基本上搜索cURL返回的html中的字符串,如果找到它我需要它将它回显到一个文件。现在的问题是我遇到了一些错误:
./checkURL.sh: line 4: syntax error in conditional expression
./checkURL.sh: line 5: syntax error near `then'
./checkURL.sh: line 5: `then'
这是我的代码:
#!/bin/bash
test="curl https://example.com"
result=$(eval "$test")
if [[ $result == *turtles*]]
then
echo "its there";
fi
我从另一个stackoverflow问题中提取了if语句的示例,它似乎对OP做了与我相同的事情,所以我不确定我的代码出了什么问题....
答案 0 :(得分:1)
你需要一个空间:
if [[ $result == *turtles*]]
^
|
--------------------------