我在网站上发现我可以使用以下命令在Fedora 20上安装sublime 3:
卷曲-L http://git.io/3Wr2CQ | SH
运行命令后,我无法打开Sublime。
我收到以下错误:
/usr/local/bin/subl: line 2: [: ==: unary operator expected
请在下面看到终端的副本:
[pc@pc-z710 ~]$ curl -L http://git.io/3Wr2CQ | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
100 1065 100 1065 0 0 543 0 0:00:01 0:00:01 --:--:-- 1040k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7300k 100 7300k 0 0 2625k 0 0:00:02 0:00:02 --:--:-- 2625k
[sudo] password for red:
mv: inter-device move failed: ‘/home/red/sublime_text_3/’ to ‘/opt/sublime_text_3’; unable to remove target: Directory not empty
ln: failed to create symbolic link ‘/bin/subl’: File exists
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 166k 100 166k 0 0 103k 0 0:00:01 0:00:01 --:--:-- 103k
Sublime Text 3 installed successfully!
Run with: subl
[pc@pc-z710 ~]$ subl
/usr/local/bin/subl: line 2: [: ==: unary operator expected
[pc@pc-z710 ~]$ uname -m
x86_64
答案 0 :(得分:8)
将${1}
更改为"${1}"
,以便在没有给出参数时评估为shell中的空字符串。
同时检查sublime_text的位置。我必须将路径从/usr/local/sublime-text-3/sublime_text
更改为/usr/local/sublime-text-3/sublime_text_3/sublime_text
。