无法从 Zsh 获取 Google 搜索工作
我的 .Zshrc 中有以下代码,
function google; {
$VIEW "http://www.google.com/search?q='url-encode "${(j: :)@}"'"
}
我得到
google masi
google:1: no such file or directory: http://www.google.com/search?q='url-encode masi'
如何您可以在 Zsh 中使用 Google 搜索吗?
I have the following code in my .Zshrc
function google; {
$VIEW "http://www.google.com/search?q='url-encode "${(j: :)@}"'"
}
I get
google masi
google:1: no such file or directory: http://www.google.com/search?q='url-encode masi'
How can you get Google Search to work in Zsh?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
以下解决了 Mac
和 Ubuntu 中的问题
The following solves the problem in Mac
and in Ubuntu
对 zsh 一无所知,但看起来您的报价有问题。
看起来它会将 url 评估为
“这可能不是您想要的”。 (“masi”的 url 编码版本)?
Don't know anything about zsh but looks like you've got a problem with your quotes.
Looks like it evaluates the url to being
Which probably isn't what you were after. (url encoded version of 'masi') ?
$VIEW 的价值是多少?
将其设置为网络浏览器或下载器的路径。
What's the value of $VIEW?
Set it to the path of a web browser or downloader.