错误使用echo命令使整个etcprofile文件出错

it2023-01-13  58

今天安装kafka时,因为使用了echo命令配置环境变量

错误命令:echo export KAFKA_HOME=/opt/soft/kafka/kafka-1.1.1 > /etc/profile

正确命令:echo ‘export KAFKA_HOME=/opt/soft/kafka/kafka-1.1.1’ >> /etc/profile

然后整体的/etc/profile就成了这样[root@bruce03 etc]# vim profile

export PATH=.:/opt/hbase/hbase-1.3.1/bin:.:/opt/zookeeper/zookeeper-3.4.10/bin:.:/opt/sqoop/sqhutdown -r nowop-1.4.6/bin:.:/usr/local/mysql/bin:.:/opt/hive/hive-1.2.2/bin:/opt/hadoop/hadoop-2.7.7/bin:/opt/hadoop/hadoop-2.7.7/sbin:.:/opt/java/jdk1.8.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin

并且命令全部可用,找了好久不知道怎么解决,特此记录一下

准备全部删除,然后再把之前的都加进去

最新回复(0)