我对脚本Googliser和Mac命令有疑问。
我几天前在Mac shell中尝试过这个脚本并使其正常工作。我按照列出的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
易。它工作,而不是第一次,我不记得我是如何工作的。但后来,我做了我的魔法,它停止了工作。
问题与gnu终端和Darwin终端中命令的差异有关。达尔文不允许ln --I
,但在脚本中使用它等。
因此,每当我尝试运行脚本时,我都会得到:
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
文件有关,现在它是空的。
如果我要求brew list
,我就安装了这个。现在很少,重新安装一切:
gettext montage
gnu-getopt openssl wget
我遗失了一些东西 - 我是,很多东西 - 。但是,有人知道为什么会这样吗?
<磷>氮答案 0 :(得分:0)
好的,请回答: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
它有效。
<磷>氮