我想寫一個腳本,以谷歌搜索終端。下面是代碼:谷歌搜索終端
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
是啊我現在編輯它..我的壞:) –