如何在 shell 脚本中使用curl 打印grep 结果?

如何在 shell 脚本中使用curl 打印grep 结果?

如何在 shell 脚本中打印 grep 结果?这是我的代码:

#url is https://batteryzone.pk/assets/kcfinder/browse.php
read -p "Url: " url
response=$(curl -Lsk $url | grep uploadURL)
if [[ $response =~ uploadURL ]]; then
echo "$url$response"
fi
#and I want the result is $url/uploadfiles/kcfinder

结果是curl -Lsk https://batteryzone.pk/assets/kcfinder/browse.php | grep uploadURL

$ curl -Lsk https://batteryzone.pk/assets/kcfinder/browse.php | grep uploadURL
_.uploadURL = "/assets/kcfinder/upload";
_.thumbsURL = _.uploadURL + "/.thumbs";

我想"$url$response"成为$url/uploadfiles/kcfinder

相关内容