当在命令行上运行curl命令时,使用'&'括住url引号是可行的,但是在shell脚本中运行时,它不能按预期工作。
curl -Lks -o /dev/null -w "%{url_effective}\n" "https://www.XXXX.com?ver=test1&ver1=test2"
Probably, you're using a different shell to interactively run that command then you specify as the shell that should execute the file.
Try executing
echo $SHELL
If you want to have the same semantics, that same shell must be used as the so-called Shebang executor.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.