bash: /etc/profile: line 11: `pathmunge () {
来源:互联网 发布:淘宝购物怎样返利 编辑:程序博客网 时间:2024/06/06 03:33
由于第一次操作linux,配置环境文件时,还是很不习惯用vi命令编辑,所以用的传输工具,拷下来在windows上编辑好,再上传上去
报错如下图:
经过仔细核查,语法是没有问题的,使用cat -v /etc/profile检查,发现里面大量的Windows下的换行符,到这里已经知道具体原因了,使用dos2unix profile将profile文件从Windows格式文件转换为Unix、Linux格式,然后在执行source profile使之生效,问题解决。
如果你的linux服务器还没安装dos2unix
那么推荐yum安装,输入以下命令即可:
yum -y install dos2unix*
以下是本次安装JDK所使用过的命令,总结如下:
#解压ZIP文件
unzip apache-tomcat-8.0.3-windows-x64.zip -d /root/tomcat8
#解压linux的tar文件
tar -zxvf jdk-7u79-linux-x64.tar.gz
#安装dos2unix的yum命令
yum -y install dos2unix*
#windows文件转linux文件格式命令
dos2unix profile
#设置JDK环境变量
JAVA_HOME=/usr/java/jdk1.7.0_79
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
#环境变量生效命令,无须重启服务器
source /etc/profile
#查看配置的环境变量路径是否生效,这里以JAVA_HOME为例
echo $JAVA_HOME
#查看服务器上java版本
java -version
#删除指定路径下的文件夹及其所有子文件,请务必谨慎操作!!!
rm -rf /usr/java/
- bash: /etc/profile: line 11: `pathmunge () {
- /etc/bash.bashrc、/etc/profile、终端 设置
- 关于Debian中的/etc/.profile, /etc/bash.bashrc, ~/.bashrc, ~/.profile,
- Linux中的~/.profile,~/.bashrc,/etc/profile,/etc/bash.bashrc
- 详解/etc/profile、/etc/bash.bahsrc、~/.profile、~/.bashrc的用途
- 详解/etc/profile、/etc/bash.bahsrc、~/.profile、~/.bashrc的用途
- Bash: about .bashrc, .bash_profile, .profile, /etc/profile, etc/bash.bashrc and others
- 启动文件rc.local、/etc/bash.bashrc、~/bashrc、/etc/profile、~/.profile【转载from joyride】值得了解
- Bash初始化文件/etc/profile .bash_pro-file .bash_login .profile .bash_logout /etc/bashrc .bashrc
- 登录shell 非登录shell /etc/bash.bashrc /etc/profile ~/.bashrc ~/.profile
- Linux安装软件时,/etc/profile、/etc/bash.bahsrc、~/.profile、~/.bashrc的用途
- Linux 配置文件 启动文件rc.local、/etc/bash.bashrc、~/bashrc、/etc/profile、~/.profile加载顺序
- 启动文件rc.local、/etc/bash.bashrc、~/bashrc、/etc/profile、~/.profile【转载from joyride】值得了解
- 启动文件rc.local、/etc/bash.bashrc、~/bashrc、/etc/profile、~/.profile【转载from joyride】值得
- Linux安装软件时,/etc/profile、/etc/bash.bahsrc、~/.profile、~/.bashrc的用途
- :/etc/profile
- /etc/profile
- /etc/profile
- spring cloud + spring boot + springmvc+mybatis分布式微服务云架构
- mt2503 [MAKE]加入BT switch机制后,makefile文件的变化
- windows平台使用Microsoft Visual C++ Compiler for Python 2.7编译python扩展
- 轻松学习 JavaScript:了解 let 语句
- Cordova App 打包全揭秘
- bash: /etc/profile: line 11: `pathmunge () {
- vs 2017 include<Pthread.h>无法打开源文件
- wampserver环境下配置虚拟域名
- C++常对象,常变量,常成员函数详解
- 摘录机器学习的基本知识以及学习路线
- JavaWeb笔记之数据源连接池
- NASA无人机障碍赛:专业选手Vs.人工智能,赌一赌谁赢?
- URL 规范
- hibernate学习教程-数据缓存