【发布时间】:2014-03-31 20:46:05
【问题描述】:
这是一个有点愚蠢的问题。我已经在我的 Mac (Marvericks OS) 上安装了 Inkscape 在这个页面之后http://www.inkscape.org/en/download/mac-os/
我知道inkscape 有一个命令行选项。我试图在终端上输入inkscape,但没有这样的命令。我很困惑……这是否意味着我需要安装 linux 版本的 inkscape 才能使用命令行?
【问题讨论】:
这是一个有点愚蠢的问题。我已经在我的 Mac (Marvericks OS) 上安装了 Inkscape 在这个页面之后http://www.inkscape.org/en/download/mac-os/
我知道inkscape 有一个命令行选项。我试图在终端上输入inkscape,但没有这样的命令。我很困惑……这是否意味着我需要安装 linux 版本的 inkscape 才能使用命令行?
【问题讨论】:
我在/Applications 中安装了 Inkscape,并从终端运行它就可以了:
/Applications/Inkscape.app/Contents/MacOS/inkscape --help
Usage: inkscape-bin [OPTIONS...] [FILE...]
Available options:
-V, --version Print the Inkscape version number
... etc.
为了便于使用,将其符号链接到/usr/local/bin,即:
ln -s /Applications/Inkscape.app/Contents/MacOS/inkscape \
/usr/local/bin/inkscape
通常,在 MacOS 上,Inkscape 需要使用绝对路径调用,并且作为参数给出的所有文件也应该是完整路径。另见:
【讨论】:
ln -s /Applications/Inkscape.app/Contents/Resources/bin/inkscape /usr/local/bin/inkscape 这会为inkscape 创建一个符号链接到标准路径中的文件夹
alias inkscape="/Applications/Inkscape.app/Contents/Resources/bin/inkscape"
/Applications/Inkscape.app/Contents/MacOS/inkscape。
截至 2020 年,MacOS 上的可执行文件现在位于
/Applications/Inkscape.app/Contents/MacOS/inkscape
您可以使用以下符号链接它:
ln -s /Applications/Inkscape.app/Contents/MacOS/inkscape \
/usr/local/bin/inkscape
更多关于命令行使用的信息here。
【讨论】:
/usr/local/bin/inkscape: line 196: /usr/Contents/MacOS/inkscape-bin: No such file or directory /usr/local/bin/inkscape: line 196: exec: /usr/Contents/MacOS/inkscape-bin: cannot execute: No such file or directory 有什么想法吗?
我认为一些路径和文件名随着时间的推移发生了变化,今天你应该在/usr/local/bin 中添加一个符号链接以指向inkscape 的bin 目录:
sudo ln -s /Applications/Inkscape.app/Contents/Resources/bin/inkscape /usr/local/bin/inkscape
完全归功于上面的@Scott,他将这个正确的“答案”显示为评论。此解决方案允许inkscape 的其他子命令正常工作,而创建别名则不能。
【讨论】: