BASH:如何将从网站返回的值存储到varuable中

BASH:如何将从网站返回的值存储到varuable中,bash,shell,Bash,Shell,这是我的密码 #!/bin/bash x = $(curl www.google.com) 这是运行名为test.sh的文件后出现的错误 MacBook-Pro:files user1$ ./test.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent

这是我的密码

#!/bin/bash
x = $(curl www.google.com)
这是运行名为test.sh的文件后出现的错误

MacBook-Pro:files user1$ ./test.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 19091    0 19091    0     0  58596      0 --:--:-- --:--:-- --:--:-- 58561
./test.sh: line 2: x: command not found

您需要删除
=
符号前后的空格

x=$(curl www.google.com)

太蠢了。。。谢谢一个百万富翁你不知道我花了多长时间来解决这个问题