我想写一个脚本,以谷歌搜索终端。下面是代码:谷歌搜索终端
google.sh
#!/bin/bash
echo "Searching for : [email protected]"
for term in [email protected] ; do
echo "$term"
$search = $search%20$term
done
open "http://www.google.com/search?q=$search"
每当我尝试以运行脚本:
./google.sh some string
我得到的错误是:
Searching for : some string
some
./google.sh: line 5: =: command not found
string
./google.sh: line 5: =: command not found
此外,谷歌主页在浏览器中打开。请告诉我我在做什么在这里?
'='前后应该没有空格,使用'search = $ search..' – ritesht93
这是一个bash脚本,而不是Python – Selcuk
是啊我现在编辑它..我的坏:) –