在Mac中使用Googliser

在Mac中使用Googliser

本文介绍了在Mac中使用Googliser.sh搜索图像:"ls:非法选项-我";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对脚本 Googliser 和Mac命令有疑问.

I have a question over the script Googliser and the Mac commands.

几天前,我在Mac shell中尝试了该脚本,并使其起作用.我按照此处列出的脚本:

I tried the script some days ago in the Mac shell and made it work. I followed the script listed here:

brew install wget
brew install gnu-getopt
brew link --force gnu-getopt
curl -sO https://raw.githubusercontent.com/teracow/googliser/master/googliser.sh
sed -i "" "s/readlink/stat/;s/dev\/shm/tmp/;s/p -p/p -t/" googliser.sh
chmod +x googliser.sh

容易.它起作用了,不是第一次,而且我不记得我是如何使它起作用的.但是后来,我做了魔术,但它停止了工作.

Easy. It worked, not the first time, and I don't remember how I made it work. But then, I did my magic, and it stopped working.

问题与gnu终端和Darwin终端中命令的差异有关.在达尔文中,不允许使用ln --I,但是在脚本中使用了ln --I.

The problem has something to do with the differences of the commands in the gnu terminal and the Darwin terminal. ln --I is not allowed in Darwin, but it is used, among others, in the script.

因此,每次我尝试运行脚本时,都会得到:

So everytime I try to run the script I get:

usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
ls: illegal option -- I
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
ls: illegal option -- I
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
       0/10 result groups downloaded. ls: illegal option -- I
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
ls: illegal option -- I
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
ls: illegal option -- I
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
sed: 1: "/youtube/Id;/vimeo/Id;s ...": invalid command code I
No results!

我不想放弃,因为它奏效了.我试图通过安装coreutils和其他软件包来修复它以获得gnu命令,但是没有成功.也许它与.bash_profile文件也有关系,但现在为空.

I don't want to give up, because it worked. I tried to repair it installing coreutils and other packages to get the gnu commands, but no success. Maybe it has something to do as well with the .bash_profile file, now it is empty.

如果我要求使用brew list,则表示我已安装了该软件.现在很少的东西,重新安装一切:

If I ask for a brew list it sais I have this installed. Very few things now, reinstalled everything again:

gettext     montage
gnu-getopt  openssl     wget

我缺少一些东西-确保我有很多东西-.但是,有人知道为什么会这样吗?

I am missing something —sure I am, lots of things—. But, does somebody know why is this happening?

N.

推荐答案

好,在这里回答: https ://gist.github.com/dardo82/567eac882b678badfd097bae501b64e2/

#!/bin/sh

brew install      wget
brew install      ghostscript
brew install      coreutils
brew install      gnu-sed
brew install      gnu-getopt
brew link --force gnu-getopt

curl -O https://raw.githubusercontent.com/teracow/googliser\
\/master/googliser.sh

sed -i "" "s/readlink/greadlink/;\
       s/mktemp/gmktemp/;\
       s/head/ghead/;\
       s/ sed / gsed /g;\
       s/(du /(gdu /;\
       s/(ls /(gls /g;\
       s/dev\/shm/tmp/"\
     googliser.sh
chmod +x googliser.sh

它有效.

N.

这篇关于在Mac中使用Googliser.sh搜索图像:"ls:非法选项-我";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 21:13