/etc/profile修改了报错
Tofloor
poster avatar
xycc
deepin
2018-03-29 06:04
Author
想添加个环境变量 在/etc/profile最下面添加了之后 保存出去source /etc/profile显示
  1. /etc/profile:35: no matches found: tty[1-6]
Copy the Code

我把文件修改回去也还是报这个,怎么办?
Reply Favorite View the author
All Replies
avatar
junral
deepin
2018-03-29 08:41
#1
本帖最后由 junral 于 2018-3-29 00:50 编辑

这个应该是没问题的吧,因为执行tty这个命令后,输出的是/dev/pts/1,如果你想要不报错的话,就按ALT+Ctrl+F2进入tty2,然后source /etc/profile,应该就可以了
Reply View the author
avatar
w1991668899
deepin
2018-09-04 09:23
#2
我也碰到了这个问题怎么解决的
Reply View the author
avatar
spectrejie
deepin
2018-09-05 03:53
#3
https://bbs.deepin.org/post/154748
我也碰到了这个问题怎么解决的

这个问题应该出现在使用第三方shell的时候,至少我使用zsh的时候是这样,进入bash后执行就OK了
Reply View the author
avatar
moling
deepin
2020-02-18 18:35
#4
https://bbs.deepin.org/post/154748
这个应该是没问题的吧,因为执行tty这个命令后,输出的是/dev/pts/1,如果你想要不报错的话,就按ALT+Ctrl+ ...

这个也不行
Reply View the author
avatar
deepinuser17
deepin
2020-02-18 19:35
#5
出错的是35行。 先注释/etc/profile的35行, 运行
  1. source /etc/profile
Copy the Code


如果出了错误,第一步就是退出所做的更改。

在求助时,应该把所做的修改以及相关的行发布出来,这样别人才可以看到是哪里出了问题。 光有出错信息并不够。

一般而言,直接修改系统初始的配置文件是不推荐的。如果想要加入环境变量,可以加在/home/<用户>/.bashrc里。 如果要是供给多人使用,可以创建一个文件,放在/etc/profile.d文件加里。
Reply View the author
avatar
deepinuser17
deepin
2020-02-18 19:39
#6
https://bbs.deepin.org/post/154748
这个问题应该出现在使用第三方shell的时候,至少我使用zsh的时候是这样,进入bash后执行就OK了
...

zsh和bash shell不完全兼容。

每个shell都有自己专属的配置文件:

bash:  ~/.bashrc
zsh:  ~/.zshrc

用户的环境变量应该加到各自shell配置文件里。
Reply View the author