那么,假设我有以下命令:
curl -I http://google.com | head -n 1| cut -d $' ' -f2
这将捕获http状态码吗?现在我想将其分配给变量.. 在bash脚本中。
like output = "curl -I http://localhost:8088/tracks?key=9 | head -n 1| cut -d $' ' -f2"
我该如何在Bash中将上述命令的响应分配给名为output的变量? 谢谢
那么,假设我有以下命令:
curl -I http://google.com | head -n 1| cut -d $' ' -f2
这将捕获http状态码吗?现在我想将其分配给变量.. 在bash脚本中。
like output = "curl -I http://localhost:8088/tracks?key=9 | head -n 1| cut -d $' ' -f2"
我该如何在Bash中将上述命令的响应分配给名为output的变量? 谢谢